@font-face {
  font-family: "Fuggles";
  src: url("/public/fonts/Fuggles-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Average Sans";
  src: url("/public/fonts/AverageSans-Regular.ttf") format("truetype");
  font-display: swap;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

body {
  padding: 2rem;
  background: linear-gradient(135deg, #f5f2ef, #e8d8c3);
  color: #333;
}

a {
  &:link,
  &:visited,
  &:hover,
  &:active {
    text-decoration: none;
    color: inherit;
  }
}

h1 {
  margin: 0.35em 0;
}

.fuggles-regular {
  font-family: "Fuggles", cursive;
  font-weight: 400;
  font-style: normal;
}

.average-sans-regular {
  font-family: "Average Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.hide {
  display: none;
}

.sticky-banner {
  /* 1. Positioning */
  position: fixed;
  /* Change to 'top: 0' if you want it at the top */
  left: 0;
  width: 100%;
  z-index: 1000;  /* Ensures it sits on top of other content */

  /* 2. Visuals */
  background-color: #bbb;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1); /* Subtle shadow for depth */
  padding: 10px;
  box-sizing: border-box;

  /* 3. Layout (Flexbox is best here) */
  display: flex;
  flex-direction: column; /* Stack "Shop" on top of buttons */
  align-items: center;    /* Center everything */
  gap: 10px;

  filter: invert(1);

  &.sticky-banner-top {
    top: 0;
    position: absolute;
  }

  &.sticky-banner-bottom {
    bottom: 0;
  }

  .menu-container {
    display: inline-grid;
    width: 100%;
    justify-items: center;
    font-size: 1.25rem;

    &.two-buttons {
      grid-template-columns: 1fr 1fr;
    }

    .menu-item {
      width: 100%;
      text-align: center;
    }
  }
}

.container {
  background-color: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  
  h2.title {
    text-align: center;
    font-size: 1.75rem;
    margin-top: 0;
  }
}

#main {
  margin: 85px 0 50px;
  display: inline-flex;
  flex-direction: column;
  gap: 50px;
}

#product-container {
  .product-item {
    display: none;

    &.template {
      display: none;
    }

    &.active {
      display: inline-grid;
    }

    &:first-child {
      button.previous-button {
        display: none;
      }
    }

    &:last-child {
      button.next-button {
        display: none;
      }
    }

    .product-item-image-container {
      position: relative;
      text-align: center;

      img {
        width: 250px;
        height: 350px;
      }

      button {
        position: absolute;
        top: 50%;
        width: 30px;
        height: 30px;
        border-radius: 30px;
        border: 0;
        opacity: 0.75;

        background-color: #000;
        background-image: url('images/icons/slider-button.svg');
        background-size: 75%;
        background-repeat: no-repeat;
        background-position: 5px 3px;

        &.previous-button {
          transform: translateY(-50%) rotateY(180deg);
          top: 54%;
          left: 3px;
        }

        &.next-button {
          right: 3px;
        }
      }
    }

    .product-item-details-content {
      display: inline-flex;
      flex-direction: column;
      align-items: center;

      p {
        margin: 0.75rem 0;

        &.product-item-details-description {
          text-align: center;
        }
  
        &.product-item-details-price {
          font-size: 1.2rem;
          font-weight: 600;
          font-style: italic;
  
          &::before {
            content: "฿";
          }
        }
      }

      button {
        background-color: rgb(0, 116, 212);
        color: #fff;
        border-radius: 5px;
        width: 150px;
        max-width: 300px;
        height: 35px;
        border: none;
        font-weight: bold;
        margin: 10px 0 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;

        .icon {
          width: 15px;
          height: 15px;
          background-image: url('images/icons/credit-card.svg');
          background-size: 100%;
          background-repeat: no-repeat;
        }

        .loader {
          border: 3px solid #f3f3f3; /* Light grey border */
          border-top: 3px solid #3498db; /* Blue border for the spinning part */
          border-radius: 50%;
          width: 9px;
          height: 9px;

          /* Initially hide the spinner */
          display: none;

          /* Animation definition */
          animation: spin 1s linear infinite;

          &.loading {
            display: inline-block;
          }
        }
      }
      
      .accept-with-stripe {
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;

        &::before {
          content: "Accept payments with";
        }

        img {
          width: 30px;
          height: 14px;
        }
      }
    }
  }
}

#store-container {
  h2 {
    text-align: center;
  }

  hr {
    margin-bottom: 2.5rem;
    border-top: 2px solid #333;
  }

  gmp-map {
    height: 350px;
  }

  .store-item:last-child {
    hr {
      display: none;
    }
  }
}

@media screen and (min-width: 600px) {
  body {
    justify-content: center;
    display: flex;
  }

  #main {
    #product-container .product-item .product-item-image-container img {
      width: 450px;
      height: 650px;
    }

    #store-container {
      min-width: 450px;

      .store-item gmp-map {
        height: 500px;
      }
    }
  }
}

@media screen and (min-width: 1000px) {
  .sticky-banner-bottom {
    display: none !important;
  }

  #main {
    flex-direction: row;
    align-items: flex-start;

    #product-container {
      max-width: 400px;

      .product-item .product-item-image-container img {
        width: 350px;
        height: 500px;
      }
    }
  }
}
