@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --navy: #A4C3D2; /* Glacier Blue */
  --navy-light: #7A9FB0;
  --navy-dark: #0d1b2a;
  --white: #ffffff;
  --off-white: #f8f9fa;
  --gray: #e0e1dd;
  --accent: #d4af37; /* subtle gold accent for elegance */
}

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

html {
  font-size: 13px; /* Reduced another ~10% from 14px */
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--navy-dark);
  background-color: var(--white);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
}

/* Utilities */
.container {
  max-width: 1100px; /* Reduced from 1280px (~15-20%) */
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center { text-align: center; }
.text-white { color: var(--white); }
.bg-navy { background-color: var(--navy); color: var(--navy-dark); }
.bg-off-white { background-color: var(--off-white); }

.section-padding { padding: 6rem 0; }
.section-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: inherit;
}
.section-subtitle {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  font-weight: 500;
  color: var(--accent);
}

.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background-color: var(--navy);
  color: var(--white);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: 1px solid var(--navy);
  cursor: pointer;
}

.btn:hover {
  background-color: transparent;
  color: var(--navy);
}

.btn-white {
  background-color: var(--white);
  color: var(--navy);
  border-color: var(--white);
}

.btn-white:hover {
  background-color: transparent;
  color: var(--white);
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  z-index: 1000;
  transition: all 0.4s ease;
}

header.scrolled {
  background: rgba(164, 195, 210, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.brand-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--navy-dark);
  margin: 0;
  letter-spacing: 1px;
  line-height: 1;
}

header:not(.scrolled) .brand-title {
  color: var(--white);
}

.brand-location {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 5px 0 0 0;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 400;
}

.brand-decoration {
  width: 40px;
  height: 8px;
  margin-top: 5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.cart-icon {
  position: relative;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--white);
  transition: color 0.3s;
}

header.scrolled .cart-icon {
  color: var(--navy-dark);
}

.menu-toggle {
  font-size: 1.5rem;
  color: var(--white);
  cursor: pointer;
}

header.scrolled .menu-toggle {
  color: var(--navy-dark);
}

#cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 50%;
  font-weight: 600;
}

.logo img {
  height: 70px; /* Reduced from 85px */
  width: auto;
  transition: all 0.4s ease;
}

header.scrolled .logo img {
  height: 52px; /* Reduced from 60px */
}

/* Hero */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
  background: url('fondohero.jpeg') center/cover no-repeat;
}



.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(13, 27, 42, 0.5), rgba(13, 27, 42, 0.7));
  backdrop-filter: blur(2px);
  z-index: -1;
}

.hero-content {
  max-width: 850px;
  padding: 4rem 3rem;
  background: rgba(13, 27, 42, 0.4);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 1.5s ease-out forwards;
}

.hero-location {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.hero-title {
  font-size: 4rem; /* Reduced from 5rem */
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-style: italic;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-desc {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Nuestra Selección Section Background */
#nuestra-seleccion {
  position: relative;
  overflow: hidden;
}

#nuestra-seleccion::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  background: url('logo1.png') no-repeat center;
  background-size: contain;
  opacity: 0.04;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

#nuestra-seleccion .container {
  position: relative;
  z-index: 1;
}

/* Selection Grid */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 per line on desktop */
  gap: 1.5rem;
  margin-top: 4rem;
}

.selection-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.selection-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card-image {
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

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

.card-info {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column; /* Vertical layout for 4-column grid */
  align-items: center;
  text-align: center;
  gap: 1rem;
  background: #F9F7F2;
  flex: 1;
}

.card-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 50%;
  border: 1px solid rgba(13, 27, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--navy-dark);
  background: var(--white);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  margin-top: -3rem; /* Floating effect for 4-column layout */
  z-index: 5;
}

.card-text {
  flex: 1;
  min-width: 0; /* Important for text truncation/wrapping */
}

.card-title {
  font-size: 1.4rem;
  color: var(--navy-dark);
  margin-bottom: 0.2rem;
  font-family: 'Playfair Display', serif;
  white-space: normal;
}

.card-subtitle {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Store Section */
.store-section {
  text-align: center;
  background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), url('img/vinos_1776821653290.png');
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

.store-section .section-title {
  color: var(--navy);
}

.store-section p {
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 per line on desktop */
  gap: 1.5rem;
  margin-top: 3rem;
}

.product-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.product-info {
  padding: 1.5rem;
}

.product-info h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--navy-dark);
}

.product-info p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
  height: 3em;
  overflow: hidden;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}

.add-to-cart-btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.3s;
}

.add-to-cart-btn:hover {
  opacity: 0.9;
}

/* Promo Grid */
.promo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 per line on desktop */
  gap: 1.5rem;
  margin-top: 3rem;
  position: relative;
  z-index: 5;
}

.promo-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.promo-card img {
  height: 200px;
  object-fit: cover;
}

.promo-info {
  padding: 1.5rem;
  text-align: left;
}

.promo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

/* Offers Section */
.offers {
  background-color: var(--navy);
  color: var(--navy-dark);
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 8rem 0;
}

.offers-bg-marquee {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: flex;
}

.offers-marquee-track {
  display: flex;
  height: 100%;
  animation: marqueeImages 40s linear infinite;
}

.offers-marquee-track img {
  height: 100%;
  width: 300px;
  object-fit: cover;
  opacity: 0.6;
}

.offers-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(164, 195, 210, 0.75);
  z-index: 1;
}

@keyframes marqueeImages {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Delivery Section */
.delivery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.delivery-box {
  background: var(--off-white);
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  transition: transform 0.3s ease;
}

.delivery-box:hover {
  transform: translateY(-5px);
}

.delivery-box h3 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--navy);
}

.delivery-box p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #555;
}

/* History Section */
.history-section {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.history-content {
  flex: 1;
}

.history-content h2 {
  font-size: 3.5rem;
  margin-bottom: 2rem;
  line-height: 1.2;
}

.history-content p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #444;
}

.history-image {
  flex: 1;
  position: relative;
}

.history-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(13, 27, 42, 0.1);
}

/* Marquee */
.marquee-container {
  overflow: hidden;
  background: var(--navy-light);
  padding: 3rem 0;
  white-space: nowrap;
  position: relative;
  display: flex;
}

.marquee-content {
  display: inline-flex;
  animation: marquee 30s linear infinite;
}

.marquee-item {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 3rem;
  transition: color 0.3s;
}

.marquee-item:hover {
  color: rgba(255, 255, 255, 1);
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Contact Section */
.contact-section {
  background-color: var(--navy);
  color: var(--navy-dark);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info h3 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.contact-item {
  margin-bottom: 2rem;
}

.contact-item h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.contact-item p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.contact-form {
  background: rgba(255, 255, 255, 0.05);
  padding: 3rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(13, 27, 42, 0.3);
  color: var(--navy-dark);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.form-control::placeholder {
  color: rgba(13, 27, 42, 0.5);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  width: 100%;
  background: var(--accent);
  color: var(--navy);
  border: none;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.3s;
}

.submit-btn:hover {
  background: var(--white);
}

/* Footer */
footer {
  background: var(--navy-light);
  color: rgba(13, 27, 42, 0.6);
  text-align: center;
  padding: 4rem 0;
  font-size: 0.9rem;
}

.footer-logo {
  margin-bottom: 2rem;
}

.footer-logo img {
  height: 115px;
  width: auto;
  opacity: 0.9;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(164, 195, 210, 0.85);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: var(--white);
  padding: 3rem;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  text-align: center;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #aaa;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close-btn:hover {
  color: var(--navy);
}

/* Floating WhatsApp Button */
.floating-whatsapp {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 35px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: all 0.3s ease;
  text-decoration: none;
}

.floating-whatsapp:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  color: white;
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: var(--white);
  z-index: 3000;
  box-shadow: -10px 0 30px rgba(0,0,0,0.1);
  transition: right 0.4s ease;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  padding: 2rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-cart {
  font-size: 2rem;
  cursor: pointer;
  color: #aaa;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f5f5f5;
}

.cart-item img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
}

.item-info {
  flex: 1;
}

.item-info h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.item-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #666;
}

.remove-item {
  cursor: pointer;
  color: #ff4d4d;
  font-size: 1.2rem;
}

.cart-footer {
  padding: 2rem;
  border-top: 1px solid #eee;
  background: #f9f9f9;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.checkout-btn {
  width: 100%;
  background: #25D366;
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: opacity 0.3s;
}

.checkout-btn:hover {
  opacity: 0.9;
}

@media (max-width: 480px) {
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
}

/* --- Consolidated Mobile Media Queries (MUST BE AT THE END) --- */
@media (max-width: 768px) {
  .section-padding { padding: 3rem 0; }
  .section-title { font-size: 2rem; }
  
  .logo img { height: 45px; }
  header.scrolled .logo img { height: 40px; }

  .brand-title {
    font-size: 1.1rem;
  }
  
  .brand-location {
    font-size: 0.6rem;
    letter-spacing: 2px;
  }

  .logo-group {
    gap: 0.8rem;
  }

  .header-actions {
    gap: 1rem;
  }

  .cart-icon, .menu-toggle {
    font-size: 1.2rem;
  }

  .selection-grid, .products-grid, .promo-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
    padding: 0;
  }

  .container {
    padding: 0 1rem;
  }

  /* Category Cards Mobile */
  .card-image {
    height: 160px;
  }

  .card-info {
    padding: 1rem 0.5rem;
    gap: 0.5rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .card-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: 1rem;
    margin-top: -2.2rem;
    z-index: 5;
    background: var(--white);
    border-width: 2px;
  }

  .card-title {
    font-size: 1rem;
    white-space: normal;
    line-height: 1.2;
    margin-bottom: 0.2rem;
  }

  .card-subtitle {
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    -webkit-line-clamp: 2;
    line-height: 1.3;
  }

  /* Product Cards Mobile */
  .product-card img {
    height: 150px;
  }
  
  .product-info {
    padding: 1rem;
  }
  
  .product-info h3 {
    font-size: 1rem;
    height: 2.4em;
    overflow: hidden;
  }
  
  .product-info p {
    display: none;
  }
  
  .price {
    font-size: 1rem;
  }
  
  .add-to-cart-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}
