/* ===== VARIABLES ===== */
:root {
  --dark: #14110f;
  --dark-soft: #221e1a;
  --cream: #f2ede3;
  --white: #ffffff;
  --off-white: #faf9f7;
  --gray: #706a63;
  --gray-light: #b7b0a6;
  --border: #ececea;
  --gold: #a9835a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 17, 15, 0.06);
  --shadow-lg: 0 20px 60px rgba(20, 17, 15, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--white);
  color: var(--dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  letter-spacing: 0.2px;
}

a { text-decoration: none; color: inherit; }

ul, ol { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-dark {
  background: var(--dark);
  color: var(--cream);
}
.btn-dark:hover { background: var(--dark-soft); }

.btn-light {
  background: var(--cream);
  color: var(--dark);
}
.btn-light:hover { background: var(--white); }

.btn-outline {
  background: transparent;
  color: var(--dark);
  border-color: var(--dark);
}
.btn-outline:hover { background: var(--dark); color: var(--cream); }

.btn-sm { padding: 10px 18px; font-size: 13px; }

.btn-block { width: 100%; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.logo img {
  height: 40px;
  width: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.logo-text {
  font-size: 17px;
  letter-spacing: 0.2px;
  color: var(--dark);
}
.logo-text strong { color: var(--gold); }

.main-nav {
  display: flex;
  gap: 34px;
  margin: 0 auto;
}

.main-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--dark);
  position: relative;
  padding: 6px 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}
.main-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--off-white);
  color: var(--dark);
  transition: background 0.2s ease;
}
.icon-btn:hover { background: var(--cream); }
.icon-btn svg { width: 19px; height: 19px; }

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--dark);
  color: var(--cream);
  font-size: 10.5px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: -7px;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
}

/* ===== CATALOG ===== */
.catalog { padding: 56px 0 90px; }
.catalog:first-of-type { padding-top: 48px; }
.catalog-alt { background: var(--off-white); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 14px;
}

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
}

.section-head h2 { font-size: 34px; color: var(--dark); }

.link-underline {
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1.5px solid var(--dark);
  padding-bottom: 3px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1.05;
  background: linear-gradient(145deg, var(--off-white), var(--cream));
  overflow: hidden;
}
.product-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  transition: opacity 0.35s ease;
}
.img-bottle { opacity: 1; }
.img-box { opacity: 0; }
.product-card:hover .img-bottle,
.product-media.show-box .img-bottle { opacity: 0; }
.product-card:hover .img-box,
.product-media.show-box .img-box { opacity: 1; }

.product-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  opacity: 0.18;
}
.product-placeholder svg { width: 56px; height: 56px; }

.media-toggle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 17, 15, 0.55);
  color: var(--cream);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.media-toggle svg { width: 15px; height: 15px; }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--dark);
  color: var(--cream);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 11px;
  border-radius: 999px;
}

.product-badge.out {
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--dark);
}

.product-info {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.product-brand {
  font-size: 12px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.product-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--dark);
}

.product-ml { font-size: 12.5px; color: var(--gray-light); margin-bottom: 6px; }

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-current { font-size: 19px; font-weight: 700; color: var(--dark); }
.price-old { font-size: 13.5px; color: var(--gray-light); text-decoration: line-through; }
.price-inquire { font-size: 13.5px; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.3px; }

.add-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--cream);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.add-btn:hover { background: var(--gold); transform: scale(1.06); }
.add-btn svg { width: 18px; height: 18px; }

.add-btn:disabled {
  background: var(--border);
  color: var(--gray-light);
  cursor: not-allowed;
}
.add-btn:disabled:hover { transform: none; }

/* ===== FOOTER / CONTACT ===== */
.site-footer {
  background: var(--dark);
  color: var(--cream);
  border-top: 1px solid var(--border);
}

.footer-contact {
  padding: 56px 24px 40px;
  text-align: center;
  border-bottom: 1px solid rgba(242, 237, 227, 0.12);
}
.footer-contact-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  margin-bottom: 22px;
}
.contact-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-contact .btn-dark { background: var(--cream); color: var(--dark); }
.footer-contact .btn-dark:hover { background: var(--white); }
.footer-contact .btn-outline { border-color: var(--cream); color: var(--cream); }
.footer-contact .btn-outline:hover { background: var(--cream); color: var(--dark); }

.footer-inner {
  padding: 24px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand img { height: 30px; width: 30px; border-radius: 8px; }
.footer-brand p { font-size: 13px; color: var(--gray-light); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13.5px; color: var(--gray-light); }
.footer-links a:hover { color: var(--cream); }

/* ===== CART DRAWER ===== */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: right 0.35s ease;
}
.cart-drawer.open { right: 0; }

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-head h3 { font-size: 22px; }
.cart-drawer-head button {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--gray);
  line-height: 1;
  padding: 10px;
  margin: -10px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 24px;
}

.cart-empty {
  color: var(--gray);
  font-size: 14px;
  text-align: center;
  padding: 60px 0;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-media {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--off-white);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cart-item-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h4 { font-size: 14.5px; font-weight: 600; color: var(--dark); }
.cart-item-info span { font-size: 12.5px; color: var(--gray); }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.cart-item-qty button {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--gray-light);
  cursor: pointer;
  font-size: 20px;
  padding: 8px;
  margin: -8px;
}

.cart-footer {
  padding: 22px 24px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.cart-footer .btn + .btn { margin-top: 10px; }
.cart-footer .btn.is-disabled {
  pointer-events: none;
  opacity: 0.4;
}
.cart-pending-note {
  font-size: 12px;
  color: var(--gold);
  background: var(--off-white);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  font-size: 15px;
}
.cart-total strong { font-size: 22px; }

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,17,15,0.4);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

/* ===== PRODUCT MODAL (vista rápida) ===== */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,17,15,0.5);
  z-index: 390;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.product-modal-overlay.open { opacity: 1; pointer-events: auto; }

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.product-modal.open { opacity: 1; pointer-events: auto; }

.product-modal-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.3s ease;
}
.product-modal.open .product-modal-box { transform: translateY(0) scale(1); }

.product-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--off-white);
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--dark);
  cursor: pointer;
  z-index: 2;
}
.product-modal-close:hover { background: var(--cream); }

.product-modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.product-modal-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(145deg, var(--off-white), var(--cream));
  border-radius: var(--radius) 0 0 var(--radius);
  overflow: hidden;
}
.product-modal-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 30px;
  transition: opacity 0.35s ease;
}
.product-modal-media .img-box { opacity: 0; }
.product-modal-media.show-box .img-bottle { opacity: 0; }
.product-modal-media.show-box .img-box { opacity: 1; }

.product-modal-info {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product-modal-info .product-brand { font-size: 13px; }
.product-modal-info .product-name { font-size: 30px; }
.product-modal-info .product-ml { margin-bottom: 4px; }

.product-modal-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 22px;
}
.product-modal-price .price-current { font-size: 26px; }

.product-modal-qty {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.product-modal-qty button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.product-modal-qty span { font-size: 16px; font-weight: 600; min-width: 18px; text-align: center; }

@media (max-width: 640px) {
  .product-modal-content { grid-template-columns: 1fr; }
  .product-modal-media { border-radius: var(--radius) var(--radius) 0 0; }
  .product-modal-info { padding: 26px 24px 32px; }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: var(--cream);
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
  max-width: 90vw;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== INSTAGRAM FLOAT ===== */
.instagram-float {
  position: fixed;
  bottom: 98px;
  right: 26px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af, #515bd4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(221, 42, 123, 0.35);
  z-index: 250;
  transition: transform 0.2s ease;
}
.instagram-float:hover { transform: scale(1.08); }
.instagram-float svg { width: 22px; height: 22px; }

/* ===== CHAT ASISTENTE ===== */
.chat-float {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--cream);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 260;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.chat-float:hover { transform: scale(1.08); background: var(--dark-soft); }
.chat-float svg { width: 26px; height: 26px; }
.chat-float.open svg { display: none; }
.chat-float.open::after {
  content: "\2715";
  font-size: 20px;
  line-height: 1;
}

.chat-panel {
  position: fixed;
  bottom: 98px;
  right: 26px;
  width: 350px;
  max-width: 90vw;
  height: 480px;
  max-height: 70vh;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 270;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-panel-head {
  background: var(--dark);
  color: var(--cream);
  padding: 16px 18px;
  font-weight: 600;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-panel-head button {
  background: none;
  border: none;
  color: var(--cream);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 6px;
  margin: -6px;
}

.chat-panel-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--off-white);
  color: var(--dark);
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--dark);
  color: var(--cream);
  border-bottom-right-radius: 4px;
}

.chat-panel-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.chat-chip {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--dark);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.chat-chip:hover { background: var(--off-white); }

.chat-panel-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-panel-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}
.chat-panel-input input:focus { border-color: var(--gold); }
.chat-panel-input button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--dark);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-panel-input button svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
  .chat-panel {
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: 78vh;
    max-height: 78vh;
    border-radius: 18px 18px 0 0;
  }
  .instagram-float, .chat-float { bottom: 20px; }
  .chat-float { right: 20px; }
  .instagram-float { right: 88px; }
}

/* Táctil: sin :hover, mostramos el botón para alternar botella/caja */
@media (hover: none) {
  .media-toggle { display: flex; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .menu-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 20px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.3s ease;
    z-index: 99;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .logo-text { display: none; }
  .catalog { padding: 40px 0 60px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .section-head h2 { font-size: 27px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-info { padding: 14px 14px 16px; }
  .product-price { gap: 4px; }
  .price-current { font-size: 15px; }
  .price-old { font-size: 10.5px; }
  .add-btn { width: 36px; height: 36px; }
  .add-btn svg { width: 15px; height: 15px; }
}
