@import url("https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=Source+Sans+Pro:wght@300;400;500;600&display=swap");

:root {
  --coffee-gold: #b3997d;
  --coffee-dark: #192447;
  --coffee-light: #c4a888;
  --coffee-darker: #243251;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Source Sans Pro", sans-serif;
  background: linear-gradient(
    135deg,
    var(--coffee-dark) 0%,
    var(--coffee-darker) 100%
  );
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Gate Animation */
.gate {
  position: fixed;
  top: 0;
  width: 50%;
  height: 100vh;
  background: linear-gradient(
    135deg,
    #192447 0%,
    #243251 25%,
    #b3997d 75%,
    #c4a888 100%
  );
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.gate::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(179, 153, 125, 0.3) 0%,
    rgba(25, 36, 71, 0.8) 50%,
    rgba(179, 153, 125, 0.3) 100%
  );
  animation: gate-shimmer 3s ease-in-out infinite;
}

@keyframes gate-shimmer {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.gate-left {
  left: 0;
  transform-origin: left center;
}

.gate-right {
  right: 0;
  transform-origin: right center;
}

.gate-left.open {
  transform: translateX(-100%);
}

.gate-right.open {
  transform: translateX(100%);
}

.gate-left.closing {
  transform: translateX(0);
}

.gate-right.closing {
  transform: translateX(0);
}

/* Chocolate Border */
.chocolate-top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: url("/assets/images/static/choco.png") repeat-x;
  background-size: auto 100%;
  z-index: 500;
  opacity: 0;
  animation: chocolate-appear 0.5s ease-out 0.5s forwards;
}

@keyframes chocolate-appear {
  to {
    opacity: 1;
  }
}

/* Main Content */

.main-content {
  padding: 100px 40px 150px; /* Increased bottom padding to account for footer */
  opacity: 0;
  animation: content-reveal 0.5s ease-out 0.7s forwards;
  flex: 1 0 auto; /* This makes the main content grow to push footer down */
}

@keyframes content-reveal {
  to {
    opacity: 1;
  }
}

/* Header */
.back-button {
  position: fixed;
  top: 100px;
  left: 20px;
  background: rgba(179, 153, 125, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(179, 153, 125, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--coffee-gold);
  font-size: 1.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
  z-index: 100;
}

.back-button:hover {
  background: rgba(179, 153, 125, 0.3);
  transform: scale(1.1);
}

.category-title {
  font-family: "Crimson Text", serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  color: var(--coffee-gold);
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

.category-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--coffee-gold),
    transparent
  );
  animation: title-underline 1s ease-out 1s forwards;
  opacity: 0;
}

@keyframes title-underline {
  to {
    opacity: 1;
  }
}

.subtitle {
  text-align: center;
  color: var(--coffee-light);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 0 2rem;
  max-width: 320px;
  margin: 0 auto;
}

.product-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(179, 153, 125, 0.2);
  transform: translateY(20px);
  opacity: 0;
  animation: card-appear 0.4s ease-out forwards;
}

.product-card:nth-child(1) {
  animation-delay: 0.8s;
}
.product-card:nth-child(2) {
  animation-delay: 0.9s;
}
.product-card:nth-child(3) {
  animation-delay: 1s;
}
.product-card:nth-child(4) {
  animation-delay: 1.1s;
}
.product-card:nth-child(5) {
  animation-delay: 1.2s;
}
.product-card:nth-child(6) {
  animation-delay: 1.3s;
}
.product-card:nth-child(7) {
  animation-delay: 1.4s;
}
.product-card:nth-child(8) {
  animation-delay: 1.5s;
}

@keyframes card-appear {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(179, 153, 125, 0.3);
  border-color: var(--coffee-gold);
  background: rgba(255, 255, 255, 0.12);
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(179, 153, 125, 0.15),
    transparent
  );
  transition: left 0.5s ease;
  z-index: 1;
}

.product-card:hover::before {
  left: 100%;
}

.product-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.4s ease;
  cursor: pointer;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-info {
  padding: 1.5rem;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100px;
}

.product-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.product-name {
  font-family: "Crimson Text", serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--coffee-gold);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1.3;
}

/* Price Badge */
.price-badge {
  background: linear-gradient(135deg, var(--coffee-gold), var(--coffee-light));
  color: var(--coffee-dark);
  padding: 8px 14px;
  border-radius: 20px;
  font-family: "Crimson Text", serif;
  font-weight: 700;
  font-size: 1.3rem;
  text-shadow: none;
  box-shadow: 0 4px 12px rgba(179, 153, 125, 0.4);
  transform: scale(0.9);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-card:hover .price-badge {
  transform: scale(1);
  box-shadow: 0 6px 16px rgba(179, 153, 125, 0.5);
}

.price-currency {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Bottom section with ingredients button */
.product-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  min-height: 32px;
}

.ingredients-button {
  background: var(--coffee-gold);
  border: 2px solid var(--coffee-gold);
  color: var(--coffee-dark);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.ingredients-button:hover {
  background: var(--coffee-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(179, 153, 125, 0.5);
}

/* Footer */
.copyright-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(25, 36, 71, 0.9);
  backdrop-filter: blur(10px);
  padding: 15px 0;
  text-align: center;
  z-index: 10;
  opacity: 0;
  animation: footer-appear 1s ease-out 2s forwards;
  flex-shrink: 0; /* Prevents footer from shrinking */
}

@keyframes footer-appear {
  to {
    opacity: 1;
  }
}

.copyright-text {
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .chocolate-top {
    height: 70px;
  }

  .main-content {
    padding: 90px 30px 80px;
  }

  .back-button {
    top: 90px;
    left: 15px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  .products-grid {
    max-width: 100%;
    padding: 0 1.5rem;
    gap: 1.75rem;
  }

  .category-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }

  .subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
  }

  .product-image {
    height: 280px;
  }

  .product-info {
    padding: 1.25rem;
    min-height: 90px;
  }

  .product-name {
    font-size: 1.3rem;
  }

  .price-badge {
    padding: 7px 12px;
    font-size: 1.2rem;
  }

  .ingredients-button {
    padding: 7px 14px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 90px 20px 80px;
  }

  .products-grid {
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .category-title {
    font-size: 2rem;
  }

  .product-image {
    height: 260px;
  }

  .product-info {
    padding: 1rem;
    min-height: 80px;
  }

  .product-name {
    font-size: 1.2rem;
  }

  .price-badge {
    padding: 6px 10px;
    font-size: 1.1rem;
  }

  .copyright-text {
    font-size: 0.8rem;
  }
}

/* Tablet and Desktop */
@media (min-width: 769px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 680px;
    gap: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1000px;
    gap: 2rem;
  }
}
/* Image Popup Styles */
.image-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(25, 36, 71, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
}

.image-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.image-popup-container {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  animation: popup-appear 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes popup-appear {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.popup-image {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(179, 153, 125, 0.3);
}

.close-popup {
  position: absolute;
  top: -25px;
  right: -25px;
  color: var(--coffee-gold);
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  background: rgba(25, 36, 71, 0.8);
  backdrop-filter: blur(5px);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(179, 153, 125, 0.3);
  outline: none;
  transition: all 0.3s ease;
  z-index: 10;
}

.close-popup:hover {
  background: rgba(179, 153, 125, 0.2);
  transform: scale(1.1);
  color: white;
}

.product-image {
  cursor: pointer;
}

/* Responsive adjustments for popup */
@media (max-width: 768px) {
  .image-popup-container {
    max-width: 95%;
  }

  .popup-image {
    max-height: 70vh;
  }

  .close-popup {
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .popup-image {
    max-height: 60vh;
  }

  .close-popup {
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
}
