/* ===================================================================
 * Page Loader
 * ------------------------------------------------------------------- */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.75s ease, visibility 0.75s ease;
}
/* ===================================================================
 * Main Stylesheet
 * ------------------------------------------------------------------- */

/* -------------------------------------------------------------------
 * Variables
 * ------------------------------------------------------------------- */
:root {
  --font-primary: 'Montserrat', sans-serif;
  --font-secondary: 'Playfair Display', serif;
  --color-gold-primary: #b98b59;
  --color-gold-secondary: #a88f59;
  --color-gold-hover: #a0764a;
  --color-dark-bg: #1a1a1a;
  --color-dark-red: darkred;
  --color-text-light: #fff;
  --color-text-dark: #555;
}

/* Google Fonts */
body {
  font-family: var(--font-primary);
  color: var(--color-text-light);
}

/* Hero Section */
#hero {
  position: relative;
  /* The height is now determined by the carousel, removing the fixed 100vh to prevent extra space on mobile. */
}
#hero .container {
  position: relative;
  z-index: 2;
}
#hero h1 {
  font-size: 3.8rem;
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
}

/* Sections */
section {
  scroll-margin-top: 72px;
}


/* Header */
.header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s ease-in-out;

  .navbar-brand {
    padding: 5px 0;
  }

  .navbar-brand img {
    max-height: 70px;
    margin-bottom: 5px;
  }

  .nav-link {
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-dark) !important;
    margin: 0 15px;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--color-gold-primary) !important;
  }
}

.btn-primary {
  background-color: var(--color-gold-primary);
  border-color: var(--color-gold-primary);
  padding: 10px 25px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary:hover {
  background-color: var(--color-gold-hover);
  border-color: var(--color-gold-hover);
}

/* Products Section */
#productos {
  background-image: url('../img/background2.png');
  background-size: 200px;
  background-position: center;
  background-attachment: fixed;
}

.product-card {
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  overflow: hidden;

  &:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  }

  .card-title {
    color: var(--color-gold-primary);
  }

  .card-img-top {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .product-image-wrapper {
    position: relative;
    overflow: hidden;

    .product-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(95, 65, 42, 0.85);
      color: var(--color-text-light);
      display: flex;
      justify-content: center;
      align-items: center;
      opacity: 0;
      transition: opacity 0.3s ease-in-out;
      padding: 15px;
      text-align: center;
      cursor: default;

      .product-description {
        margin: 0;
        font-size: 0.85rem;
        line-height: 1.3;
      }
    }

    &:hover .product-overlay {
      opacity: 1;
    }
  }
}

/* Modal Pedidos Especiales */
#pedidosModal .modal-body {
  color: #e0e0e0;
}

#pedidosModal h3 {
  color: var(--color-gold-secondary);
}

.modal-rimini-background {
  background-image: url('../img/background2.png');
  background-repeat: repeat;
  background-size: 200px; /* Controls the size of the repeating image tile */
  border: 2px solid var(--color-gold-secondary);
}

.form-control-dark {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-gold-secondary);
  color: var(--color-text-light);
}

.form-control-dark::placeholder {
  color: #a0a0a0;
}

.form-control-dark:focus {
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--color-text-light);
  border-color: #c9b38a;
  box-shadow: 0 0 0 0.25rem rgba(168, 143, 89, 0.25);
}

.btn-whatsapp-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-gold-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease-in-out;
}

.btn-whatsapp-gold .bi {
  font-size: 1.5rem;
}

.btn-whatsapp-gold:hover {
  color: var(--color-text-light);
}

/* End Modal Pedidos Especiales */

/* Footer */
footer {
  a {
    text-decoration: none;
    color: var(--color-gold-primary);

    &:hover {
      color: var(--color-text-light);
    }
  }

  .social-links .bi {
    font-size: 1.5rem;
    transition: transform 0.2s;
  }

  .social-links a:hover .bi {
    transform: scale(1.2);
  }
}

.carousel-item {
  height: 100vh;
  /* Adjust as needed */
  min-height: 600px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.carousel-caption {
    bottom: 10%;
    left: auto;
    right: 5%;
    width: 45%;
    max-width: 500px;
    text-align: right;
    background: rgba(0, 0, 0, 0.45);
    padding: 1.5rem 2rem;
    border-radius: 0.5rem;

    h2 {
        font-size: 2.5rem;
        font-weight: 700;
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    }
}

.carousel-caption p {
  font-size: 1.1rem;
  margin-bottom: 0;
}

.footer-logo {
  max-height: 100px;
  margin-bottom: 10px;
}

/* Responsive Carousel for Mobile */
@media (max-width: 767.98px) {
  .carousel-item {
    height: 60vh;
    /* A more suitable height for mobile */
    min-height: 400px;
  }

  .carousel-caption {
    display: block !important;
    /* This makes the caption visible on mobile, overriding Bootstrap's d-none */
    width: auto;
    left: 5%;
    right: 5%;
    bottom: 2rem;
    /* Adjust vertical position */
    text-align: center;
    padding: 1rem;
    max-width: none;
  }

  .carousel-caption h2 {
    font-size: 1.8rem;
    /* More readable on smaller screens */
  }

  .carousel-caption p {
    font-size: 1rem;
  }
}

.price-tag {
  background-color: #e9ecef;
  padding: 0.5em 0.75em;
  border-radius: 0.25rem;
}

#contacto {
  background-image: url('../img/background2.png');
  background-size: 200px;
  background-position: center;
  background-attachment: fixed;
}

#nosotros {
  background-color: var(--color-dark-red);
}

/* Category Card Styles */
.category-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  aspect-ratio: 1 / 1;
  /* Makes the card a perfect square */
  cursor: pointer;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
  }

  .category-title {
    position: absolute;
    bottom: 15px;
    right: 20px;
    color: var(--color-text-light);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    transition: opacity 0.3s ease-in-out;

    h4 {
      text-align: right;
      margin-bottom: 0;
    }
  }

  .category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(95, 65, 42, 0.85);
    color: var(--color-text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    padding: 20px;
    text-align: center;

    .category-description {
      margin: 0;
      font-size: 0.9rem;
      line-height: 1.4;
    }
  }

  &:hover {
    img {
      transform: scale(1.1);
    }

    .category-overlay {
      opacity: 1;
    }

    .category-title {
      opacity: 0;
    }
  }
}

.btn-gold {
  --bs-btn-color: #fff;
  --bs-btn-bg: #a88f59;
  --bs-btn-border-color: #a88f59;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #937c4c;
  --bs-btn-hover-border-color: #8a7346;
  --bs-btn-focus-shadow-rgb: 168, 143, 89;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #7e693f;
  --bs-btn-active-border-color: #75613a;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #a88f59;
  --bs-btn-disabled-border-color: #a88f59;
}

.category-card.sold-out {
  cursor: not-allowed;
  position: relative;
  /* Needed for the overlay */
}

.category-card.sold-out>img {
  filter: grayscale(90%);
  opacity: 0.6;
}

.category-card.sold-out .category-overlay,
.category-card.sold-out .category-title {
  display: none;
  /* Hide the default hover effects */
}

.category-sold-out-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.sold-out-badge {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 1.2rem;
}

/* Checkout Modal Customization */
#checkoutDetailsModal .modal-header {
  background-color: var(--color-dark-bg);
  color: var(--color-gold-secondary);
  border-bottom: 3px solid var(--color-gold-secondary);
}

#checkoutDetailsModal .modal-title {
  font-weight: bold;
  font-family: var(--font-secondary);
  color: var(--color-gold-secondary);
}

#checkoutDetailsModal .modal-body {
  background-color: #fff;
  color: var(--color-dark-bg);
}

#checkoutDetailsModal .modal-footer {
  background-color: var(--color-dark-bg);
  border-top: 3px solid var(--color-gold-secondary);
}

/* Match button styles from shopping cart */
#checkoutDetailsModal .modal-footer .btn {
  background-color: transparent;
  border: 1px solid var(--color-gold-secondary);
  color: var(--color-gold-secondary);
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#checkoutDetailsModal .modal-footer .btn:hover,
#checkoutDetailsModal .modal-footer .btn:focus {
  background-color: var(--color-gold-secondary);
  color: var(--color-dark-bg);
  box-shadow: none;
}

#checkoutDetailsModal .modal-footer .btn-primary {
  background-color: var(--color-gold-secondary);
  color: var(--color-dark-bg);
}

#checkoutDetailsModal .modal-header .btn-close {
  /* Replaced filter with a custom SVG to set the color to gold (#a88f59) */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23a88f59'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
}

/* OpenStreetMap Autocomplete Suggestions */
#address-field-group {
  position: relative;
  /* Needed for positioning the autocomplete suggestions */
}

.autocomplete-suggestions {
  border: 1px solid #ddd;
  border-top: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: absolute;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background-color: #fff;
  z-index: 1056;
  /* Higher than modal z-index to appear on top */
}

.autocomplete-suggestion {
  padding: 10px;
  cursor: pointer;
}

.autocomplete-suggestion:hover {
  background-color: #f0f0f0;
}

/* Delivery cost calculator icon in checkout modal */
#delivery-cost-icon {
  background-color: var(--color-dark-red);
  color: var(--color-text-light);
  /* This will make the icon inside white */
  cursor: help;
}

#check-address-btn {
  background-color: var(--color-dark-red);
  color: var(--color-text-light);
  font-weight: bold;
  border-color: darkred;
}

#check-address-btn:hover {
  background-color: #a50000;
  /* A slightly darker red for hover */
  border-color: #a50000;
}

.elegant-modal-content {
  background-color: #f8f9fa;
  border: 1px solid var(--color-gold-secondary);
  border-radius: 0.5rem;
}

.elegant-modal-header {
  background-color: var(--color-dark-bg);
  color: var(--color-text-light);
  border-bottom: 1px solid var(--color-gold-secondary);
}

.elegant-modal-header .modal-title {
  color: var(--color-gold-secondary);
  font-family: var(--font-secondary);
  font-size: 1.25rem;
}

/* Styling for Product Cards inside the Modal */
#productosModal .card {
  background-color: rgba(10, 10, 10, 0.8);
  /* Dark, semi-transparent background */
  backdrop-filter: blur(4px);
  /* Frosted glass effect */
  border: 1px solid var(--color-gold-secondary);
  color: var(--color-text-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  /* Ensure cards have same height */

  &:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(168, 143, 89, 0.35);
  }

  .card-img-top {
    border-bottom: 1px solid var(--color-gold-secondary);
  }

  .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .card-title {
    color: var(--color-text-light);
    font-family: var(--font-secondary);
  }

  .product-price {
    align-self: center;
    background-color: var(--color-gold-secondary);
    color: var(--color-dark-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: inline-block;
  }

  .btn {
    background-color: transparent;
    border: 1px solid var(--color-gold-secondary);
    color: var(--color-gold-secondary);
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;

    &:hover,
    &:focus {
      background-color: var(--color-gold-secondary);
      color: var(--color-dark-bg);
      box-shadow: none;
    }
  }
}

/* ===================================================================
 * Shopping Cart Styles
 * ------------------------------------------------------------------- */
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.375rem;
  flex-shrink: 0; /* Prevents the image from shrinking */
}

.cart-item-details {
  flex-grow: 1;
}

/* ===================================================================
 * Product Image Wrapper Styles
 * ------------------------------------------------------------------- */
.product-image-wrapper {
  aspect-ratio: 1 / 1;
}

/* Ensures product images are square and scale properly (Fallback for older browsers) */
.product-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  overflow: hidden;
  border-radius: var(--bs-card-inner-border-radius);
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.pulse-animation {
  width: 150px;
  animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(0.9);
  }
}

/* Product Detail Section */
#detalle-productos {
  background-color: #fff;
  color: var(--color-text-dark);
}

#regresar-btn {
  color: var(--color-gold-primary);
  font-weight: 600;
  font-size: 1rem;
}

#regresar-btn:hover {
  color: var(--color-gold-hover);
  text-decoration: underline;
}

/* Styles for Product Detail Cards */
.detalle-producto-card {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
}

.detalle-producto-card .main-image-container {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  background-color: #f8f9fa;
  max-width: 200px;
  max-height: 200px;
  margin-left: auto;
  margin-right: auto;
}

.detalle-producto-card .main-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease-out;
}

.detalle-producto-card .main-image-container:hover .main-product-image {
  transform: scale(2);
}

.detalle-producto-card .thumbnail-gallery {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background-color: #f1f1f1;
  justify-content: center;
}

.detalle-producto-card .product-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 0.25rem;
  transition: border-color 0.2s ease;
}

.detalle-producto-card .product-thumbnail:hover,
.detalle-producto-card .product-thumbnail.active {
  border-color: var(--color-gold-primary);
}

.detalle-producto-card .card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: top;
  height: 100%;
}

.detalle-producto-card .card-title {
  font-family: var(--font-secondary);
  color: #333;
  font-size: 1.5rem;
}

.detalle-producto-card .product-price {
  color: var(--color-gold-primary);
  margin-bottom: 1.5rem;
}

/* End Product Detail Section */

.quantity-selector {
    display: flex;
}

.quantity-selector .form-control {
    width: 60px; /* A bit more space */
    text-align: center;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    flex-shrink: 0; /* Prevent input from shrinking */
}

.quantity-selector .btn {
    border-radius: 0;
}

.quantity-selector .btn:first-child {
    border-top-left-radius: var(--bs-border-radius);
    border-bottom-left-radius: var(--bs-border-radius);
}

.quantity-selector .btn:last-child {
    border-top-right-radius: var(--bs-border-radius);
    border-bottom-right-radius: var(--bs-border-radius);
}

/* Product Card Three-Column Layout Separators */
.detalle-producto-card .section-divider {
    position: relative;
}

/* The pseudo-element that creates the vertical gold line */
.detalle-producto-card .section-divider::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%; /* Starts 15% from the top */
    bottom: 15%; /* Ends 15% from the bottom */
    width: 3px;
    background-color: var(--color-gold-secondary);
    opacity: 0.6;
}

/* On smaller screens (tablets and below), hide the vertical line and use a horizontal one */
@media (max-width: 991.98px) {
    .detalle-producto-card .section-divider::after {
        display: none;
    }
    .detalle-producto-card .section-divider {
        border-bottom: 1px solid rgba(168, 143, 89, 1);
    }
}
/*--------------------------------------------------------------*/

.hero-ribbon {
  position: absolute;
  width: 520px;
  height: 80px;
  background-color: var(--color-gold-primary);
  top: 150px;
  left: -120px;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
  overflow: visible; /* Allow image to overflow */
}

.hero-ribbon .ribbon-image {
  position: absolute;
  left: 90px; /* Adjust to make it appear on the left edge */
  top: -40px; /* Adjust vertical position */
  height: 150px; /* A bit larger than the ribbon's height */
  width: auto;
  transform: rotate(45deg); /* Counter-rotate the image */
}

.hero-ribbon .ribbon-text {
  width: 100%;
  padding-left: 50px; /* Create space for the image */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-ribbon .ribbon-subtitle {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--color-dark-bg);
  margin: 0;
}

.hero-ribbon .ribbon-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-dark-bg);
  line-height: 1;
}

/* Responsive adjustments for the hero ribbon */
@media (max-width: 768px) {
  .hero-ribbon {
    /* Adjust size and position for smaller screens */
    width: 320px; /* Slightly wider for better text fit */
    height: 60px;
    top: 150px; /* Adjust vertical position */
    left: -100px; /* Expose more of the ribbon */
  }

  .hero-ribbon .ribbon-image {
    left: 60px; /* Adjust image position */
    top: -10px;
    height: 90px;
  }

  .ribbon-text {
    padding-left: 80px; /* Adjust text padding to make space for the image */
  }

  .ribbon-subtitle {
    /* Make subtitle font smaller */
    font-size: 0.7rem; /* 11.2px */
  }

  .ribbon-title {
    /* Make title font smaller */
    font-size: 1rem; /* 16px */
  }
}


