:root {
  --primary: #6B1D49;
  --whatsapp: #25D366;
  --border: #d4af37;
  --z-sidebar: 1500;
  --z-header: 1400;
  --z-mobile-header: 1400;
  --z-mini-cart: 999999;
  --sidebar-width: 240px; /* was 280px — narrower per request */
}

/* ========================================
   RESET / BASE
   ======================================== */
body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding: 0;
  background: #fdfdfd;
  color: #333;
}

/* ========================================
   DESKTOP TOPBAR (logo + language switch + cart)
   ======================================== */
.topbar {
  display: none; /* enabled below at >=768px */
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100px;
  background: white;
  z-index: var(--z-header);
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 25px;
}

/* Logo box, centered over the sidebar's width on desktop */
.header {
  display: none;
  position: fixed;
  top: 20px;
  left: calc(var(--sidebar-width) / 2);
  transform: translateX(-50%);
  z-index: var(--z-header);
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.logo-link { display: block; }

/* ========================================
   LOGO
   ======================================== */
.logo {
  width: auto;
  display: block;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  transition: all 0.3s ease;
  height: 42px;       /* mobile default */
  max-height: 42px;
}

/* ========================================
   MOBILE HEADER
   ======================================== */
.mobile-header {
  display: grid; /* hidden at >=768px below */
  grid-template-columns: auto 1fr auto; /* hamburger | logo | cart */
  align-items: center;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  background: white;
  z-index: var(--z-mobile-header);
  padding: 0 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-header .hamburger { justify-self: start; }
.mobile-header .logo-link { justify-self: center; }

.mobile-right {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-self: end;
}

.mobile-header .cart-icon { font-size: 1.7em; }

/* Sits centered directly below the logo, outside the flex row above */
.mobile-header .lang-selector-mobile {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  background: white;
  padding: 6px 10px;
  border-radius: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 6px;
  font-size: 13px;
}

/* ========================================
   HAMBURGER (mobile sidebar toggle)
   ======================================== */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  width: 50px; height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: calc(var(--z-sidebar) + 1);
}

.hamburger-icon .line {
  fill: var(--primary);
  transition: all 0.3s ease;
}

.hamburger[aria-expanded="true"] .top { transform: translateY(20px) rotate(45deg); }
.hamburger[aria-expanded="true"] .mid { opacity: 0; }
.hamburger[aria-expanded="true"] .bot { transform: translateY(-20px) rotate(-45deg); }

/* ========================================
   SIDEBAR
   ======================================== */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #f8f8f8;
  padding: 20px;
  padding-top: 80px; /* clears mobile-header by default */
  overflow-y: auto;
  border-right: 1px solid #e0e0e0;
  z-index: var(--z-sidebar);
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
  transform: translateX(-100%); /* hidden by default (mobile) */
}

#sidebar > *:first-child { margin-top: 0; }

#sidebar.open { transform: translateX(0); }

@media (max-width: 767px) {
  #sidebar .logo-container { display: none; }
}

/* ========================================
   LANGUAGE SELECTOR
   ======================================== */
.lang-selector-desktop {
  display: none; /* shown only at >=768px, see media query below */
  position: fixed;
  top: 25px;
  right: 130px; /* leaves room for the cart icon in .topbar-right */
  z-index: calc(var(--z-header) + 1);
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 12px;
  border-radius: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.lang-selector-desktop a {
  color: #4A2C59;
  text-decoration: none;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  transition: all 0.3s;
}

.lang-selector-desktop a.active { background: var(--primary); color: white; }
.lang-selector-desktop a:hover { background: #eee; }

.lang-selector-mobile {
  display: none; /* shown inside .mobile-header at <768px */
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
}

.lang-selector-mobile a { color: var(--primary); text-decoration: none; }
.lang-selector-mobile a.active { font-weight: 700; }

/* ========================================
   CART ICON / COUNT
   ======================================== */
.cart-icon {
  position: relative;
  font-size: 1.85em;
  color: #4A2C59;
  text-decoration: none;
}

.cart-count {
  position: absolute;
  top: -8px; right: -8px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-top: 1px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ========================================
   MAIN CONTENT / CONTAINER
   ======================================== */
.container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.main-content {
  margin-top: 70px; /* mobile default: clears mobile-header */
  padding: 0 15px;
}

.region-section {
  margin-left: 15px;
  margin-right: 15px;
}

/* ========================================
   PRODUCT
   ======================================== */
.product {
  display: flex;
  flex-direction: column;
  gap: 30px;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px;
  align-items: flex-start;
}

.product img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  border: 3px solid var(--border);
  background: #fff;
}

.info h1 { margin: 0 0 15px; color: var(--primary); font-size: 28px; }
.info p { margin: 8px 0; font-size: 16px; }
.info strong { color: var(--primary); }

.legal-disclaimer {
  margin: 20px 0;
  font-size: 12px;
  color: #999;
  line-height: 1.4;
}

/* ========================================
   BUTTONS
   ======================================== */
.buy-btn {
  position: relative;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--whatsapp);
  color: white;
  padding: 14px 24px;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s;
}

.buy-btn:hover { background: #20B858; transform: translateY(-2px); }

.btn-add-to-cart {
  width: 100%;
  max-width: 380px;
  margin: 10px 0 20px;
  padding: 18px 32px;
  background: #4A2C59;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(74, 44, 89, 0.35);
  transition: all 0.3s ease;
}

.btn-add-to-cart:hover {
  background: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(74, 44, 89, 0.4);
}

/* ========================================
   INFO SECTIONS / SHIPPING
   ======================================== */
.section {
  background: #f9f5f7;
  border-left: 4px solid var(--primary);
  padding: 18px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section h2 { margin: 0 0 10px; color: var(--primary); font-size: 20px; }

.shipping {
  background: #e8f5e8;
  border: 1px solid #4CAF50;
  color: #2e7d32;
  padding: 14px;
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
  margin: 20px 0;
}

.shipping a { color: #2e7d32; font-weight: 600; text-decoration: underline; }

/* ========================================
   RELATED PRODUCTS GRID
   ======================================== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 30px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

.card img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.card h4 { margin: 10px 0 5px; font-size: 15px; color: var(--primary); }
.card p { margin: 5px 0; font-weight: 600; color: #333; }

.card a {
  position: relative;
  z-index: 10;
  display: inline-block;
  margin-top: 8px;
  background: var(--primary);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
}

.overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 45px;
  background: rgba(107, 29, 73, 0.95);
  color: white;
  padding: 12px 8px;
  border-radius: 12px 12px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  text-align: left;
  overflow-y: auto;
}

.card:hover .overlay { display: block; }
.overlay p { margin: 4px 0; color: white !important; }

/* ========================================
   MINI CART DRAWER
   ======================================== */
.mini-cart {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  background: white;
  box-shadow: -12px 0 50px rgba(0, 0, 0, 0.35);
  z-index: var(--z-mini-cart);
  transition: right 0.4s ease;
  display: flex;
  flex-direction: column;
}

.mini-cart.open { right: 0; }

.mini-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #4A2C59;
  color: white;
  padding: 18px 20px;
  font-size: 1.35rem;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
}

.mini-cart-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
}

.mini-cart-item img {
  width: 80px; height: 80px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #f9f9f9;
}

.item-info { flex: 1; }
.item-info strong { display: block; font-size: 1.1rem; line-height: 1.3; }
.item-price { font-weight: 700; font-size: 1.2rem; white-space: nowrap; }

.remove-btn {
  display: block;
  margin-top: 4px;
  color: #e74c3c;
  font-size: 1.3rem;
  cursor: pointer;
}

.mini-cart-items > div:first-child {
  margin-bottom: 15px;
  color: #4A2C59;
  font-size: 1.4rem;
  font-weight: 700;
}

.mini-cart-footer {
  padding: 20px;
  border-top: 1px solid #ddd;
  background: #f9f9f9;
}

.btn-checkout {
  width: 100%;
  margin-bottom: 10px;
  padding: 16px;
  background: #4A2C59;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
}

.btn-secondary {
  display: block;
  text-align: center;
  padding: 14px;
  color: #555;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid #ccc;
  border-radius: 12px;
}

/* ========================================
   RESPONSIVE: DESKTOP (>=768px)
   ======================================== */
@media (min-width: 768px) {
  .mobile-header { display: none; }
  .topbar { display: flex; }
  .header { display: block; }
  .lang-selector-desktop { display: flex; }
  .lang-selector-mobile { display: none; }

  .logo { height: 140px; max-height: none; } /* a bit bigger than before */

  #sidebar { transform: translateX(0); padding-top: 25px; }

  .container { margin-left: calc(var(--sidebar-width) + 20px); }
  .region-section { margin-left: calc(var(--sidebar-width) + 40px) !important; margin-right: 20px; }

  .main-content { margin-top: 160px; padding: 0 30px; }

  .product { flex-direction: row; }
  .product img { width: 360px; height: 540px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

  .btn-add-to-cart { max-width: 100%; padding: 20px 40px; font-size: 19px; margin: 15px 0 25px; }

  .mini-cart { width: 420px; max-width: 420px; right: -450px; }
}

/* ========================================
   RESPONSIVE: MOBILE (<=767px) — mostly defaults above,
   a few explicit overrides for clarity
   ======================================== */
@media (max-width: 767px) {
  .container { margin-top: 80px; }
}
