/* ============ Homero Collares — Header, Topbar, Footer & Drawers ============ */
:root {
  --hm-primary: #925a41;
  --hm-primary-dark: #774530;
  --hm-secondary: #51bda9;
  --hm-secondary-dark: #3ba08d;
  --hm-text-dark: #333333;
  --hm-text-muted: #7a7a7a;
  --hm-bg-white: #ffffff;
  --hm-bg-light: #faf8f5;
  --hm-border-light: rgba(29, 45, 121, 0.12);
  --hm-border-teal: #51bda9;
  --hm-radius-card: 22px;
  --hm-radius-btn: 8px;
  --hm-font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --hm-font-condensed: 'Roboto Condensed', 'Roboto', sans-serif;
  --hm-font-slab: 'Roboto Slab', serif;

  /* Aliases para compatibilidad interna */
  --primary: var(--hm-primary);
  --primary-dark: var(--hm-primary-dark);
  --secondary: var(--hm-secondary);
  --secondary-dark: var(--hm-secondary-dark);
  --text-dark: var(--hm-text-dark);
  --text-muted: var(--hm-text-muted);
  --bg-white: var(--hm-bg-white);
  --bg-light: var(--hm-bg-light);
  --border-light: var(--hm-border-light);
  --border-teal: var(--hm-border-teal);
  --font-primary: var(--hm-font-primary);
  --font-condensed: var(--hm-font-condensed);
  --font-slab: var(--hm-font-slab);
}

/* Scoped box-sizing and font */
.topbar,
.site-header,
.site-footer,
.menu-drawer,
.cart-drawer,
#hm-toast {
  font-family: var(--font-primary);
  box-sizing: border-box;
}

.topbar *,
.site-header *,
.site-footer *,
.menu-drawer *,
.cart-drawer * {
  box-sizing: border-box;
}

/* ============ Topbar ============ */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #f0e9e4;
  padding: 10px 0;
  font-size: 17px;
  width: 100%;
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-whatsapp {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 17px;
  transition: opacity 0.2s;
  letter-spacing: 0.01em;
}

.topbar-whatsapp:hover {
  opacity: 0.8;
}

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

.topbar-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-social a {
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.topbar-social a:hover {
  opacity: 0.75;
}

.topbar-divider {
  color: #dfd5ce;
  font-size: 15px;
}

.topbar-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-family: var(--font-primary);
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 16px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.topbar-account:hover {
  opacity: 0.85;
}

/* ============ Header Principal ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #e8dfd8;
  box-shadow: 0 2px 12px rgba(146, 90, 65, 0.04);
  width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 112px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 6px;
  transition: transform 0.2s;
}

.menu-btn:hover {
  transform: scale(1.08);
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
}

.header-logo img {
  height: 92px;
  width: auto;
  max-height: 94px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.header-logo:hover img {
  transform: scale(1.03);
}

/* Menú Horizontal de Escritorio */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 52px;
}

.desktop-nav .nav-link {
  color: #925A41;
  font-family: 'Roboto', sans-serif;
  font-size: 22px; /* claramente visible y legible */
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s ease;
}

.desktop-nav .nav-link:hover,
.desktop-nav .nav-link.active {
  color: #51BDA9;
}

/* Carrito en el Header */
.header-cart-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-cart-price {
  color: #925A41;
  font-family: 'Roboto', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.cart-btn:hover {
  transform: scale(1.08);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--secondary);
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  line-height: 24px;
  border-radius: 50%;
  text-align: center;
  padding: 0 4px;
}

/* Responsivo para Tablets y Móviles (< 900px): Logo perfectamente centrado */
@media (max-width: 900px) {
  .header-inner {
    height: 76px;
    padding: 0 16px;
    position: relative;
  }
  .menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
  }
  .header-inner > .header-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .header-inner > .header-logo img {
    height: 60px;
    max-height: 60px;
    width: auto;
  }
  .desktop-nav {
    display: none;
  }
  .header-cart-wrap {
    display: flex;
    align-items: center;
    z-index: 2;
  }
  .header-cart-price {
    display: none;
  }
  .topbar-whatsapp {
    font-size: 14px;
  }
  .topbar-account span {
    display: none;
  }
}

/* ============ Footer Principal ============ */
.site-footer {
  background: #faf8f5;
  color: #925A41;
  position: relative;
  padding-top: 50px;
  padding-bottom: 30px;
  font-family: var(--font-primary);
  margin-top: auto;
  border-top: 1px solid #ede4dc;
  width: 100%;
}

.footer-shape-top {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.footer-shape-top svg {
  display: block;
  width: 100%;
  height: 35px;
}

.footer-shape-top path {
  fill: #ffffff;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr 1.2fr;
  gap: 30px;
  align-items: start;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-title {
  color: #925A41;
  font-family: 'Roboto', sans-serif;
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.footer-text {
  color: #925A41;
  font-size: 15px;
  line-height: 1.6;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-list li a {
  color: #925A41;
  text-decoration: none;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-list li a:hover {
  color: #51BDA9;
  transform: translateX(3px);
}

.footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #925A41;
  flex-shrink: 0;
}

.footer-col-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-brand-logo {
  display: inline-block;
  text-decoration: none;
}

.footer-brand-logo img {
  width: 165px;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.footer-brand-logo:hover img {
  transform: scale(1.05);
}

.footer-payment-box img {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.04));
}

@media (max-width: 1024px) {
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }
  .footer-col-logo {
    grid-column: span 2;
    order: -1;
    margin-bottom: 10px;
  }
}

@media (max-width: 640px) {
  .site-footer {
    padding-top: 40px;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .footer-col-logo {
    grid-column: span 1;
  }
  .footer-list li a {
    justify-content: center;
  }
  .footer-payment-box img {
    margin: 0 auto;
  }
}

/* ============ Menú y Carrito Drawers ============ */
.menu-overlay,
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  z-index: 99998;
  transition: opacity 0.3s ease;
}

.menu-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 85%;
  max-width: 320px;
  background: #ffffff;
  z-index: 99999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  font-family: var(--font-primary);
}

.menu-drawer.open {
  transform: translateX(0);
}

.cart-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 90%;
  max-width: 380px;
  background: #ffffff;
  z-index: 99999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  font-family: var(--font-primary);
}

.cart-drawer.open {
  transform: translateX(0);
}

.menu-drawer-header,
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
}

.menu-drawer-header .header-logo {
  position: static !important;
  transform: none !important;
  display: flex !important;
  align-items: center !important;
}

.menu-drawer-header .header-logo img {
  height: 44px !important;
  max-height: 44px !important;
  width: auto !important;
}

.cart-drawer-header h3 {
  color: var(--primary);
  font-family: var(--font-primary);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.cart-drawer-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--primary);
  cursor: pointer;
  padding: 4px;
}

.menu-search {
  position: relative;
  margin: 16px 20px;
}

.menu-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.menu-search input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}

.menu-search input:focus {
  border-color: var(--primary);
}

.menu-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

.menu-search-results {
  max-height: 380px;
  overflow-y: auto;
  border-bottom: 1px solid #ede4dc;
  background: #ffffff;
  padding: 6px 12px;
}

.msr-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  text-decoration: none;
  border-bottom: 1px solid #f6f2ee;
  transition: background 0.15s ease;
}

.msr-item:last-of-type {
  border-bottom: none;
}

.msr-item:hover,
.msr-item:active {
  background: #faf6f2;
}

.msr-item img,
.msr-ph {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0ebe6;
  border: 1px solid #ede4dc;
}

.msr-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.msr-name {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 600;
  color: #925a41;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.msr-price {
  font-size: 14px;
  font-weight: 700;
  color: #51bda9;
  display: block;
}

.msr-arrow {
  color: #c4b5ab;
  font-size: 20px;
  padding-right: 4px;
  font-weight: 300;
}

.msr-all {
  display: block;
  text-align: center;
  padding: 12px 14px;
  margin: 10px 0 6px;
  background: #fdfaf7;
  color: #925a41;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  border: 1.5px solid #925a41;
  transition: all 0.2s ease;
}

.msr-all:hover,
.msr-all:active {
  background: #925a41;
  color: #ffffff;
}

.msr-empty {
  padding: 24px 16px;
  text-align: center;
  color: #7a7a7a;
  font-size: 14px;
  line-height: 1.5;
}

.msr-empty strong {
  color: #925a41;
}

.msr-empty-link {
  color: #51bda9;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f0faf8;
  border: 1px solid #d4f0eb;
}

.menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px;
}

.menu-label {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 18px 0 8px;
  font-weight: 700;
}

.menu-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  color: var(--primary);
  font-size: 19px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid #f2f2f2;
}

.menu-nav a:hover {
  color: var(--secondary);
}

.menu-drawer-footer {
  padding: 20px;
  border-top: 1px solid var(--border-light);
  background: #faf8f5;
}

.menu-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 10px;
}

.menu-contact a {
  color: var(--primary);
  text-decoration: none;
}

.menu-made {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  margin-top: 40px;
  font-size: 17px;
}

.cart-drawer-footer {
  padding: 20px;
  border-top: 1px solid var(--border-light);
  background: #faf8f5;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 19px;
}

.cart-subtotal strong {
  color: var(--secondary);
  font-family: var(--font-condensed);
  font-size: 24px;
}

/* ============ Botones en Drawer y Minicart (Máxima especificidad) ============ */
.cart-drawer-footer .btn-primary,
.cart-drawer-footer a.btn-primary,
.cart-drawer-footer a.btn.btn-primary,
#cart-drawer .btn-primary,
#cart-drawer a.btn-primary,
.menu-drawer-footer .btn-primary,
.menu-drawer-footer a.btn-primary,
.menu-drawer-footer .menu-cta,
.menu-drawer-footer a.menu-cta,
#menu-drawer .menu-cta,
#menu-drawer a.menu-cta,
a.menu-cta {
  background-color: #925a41 !important;
  color: #ffffff !important;
  display: block !important;
  text-align: center !important;
  width: 100% !important;
  padding: 14px 24px !important;
  border-radius: var(--hm-radius-btn) !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
  font-size: 17px !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  transition: all 0.25s ease !important;
  border: none !important;
  cursor: pointer !important;
  margin-bottom: 10px !important;
}

.cart-drawer-footer .btn-primary:hover,
.cart-drawer-footer a.btn-primary:hover,
.cart-drawer-footer a.btn.btn-primary:hover,
#cart-drawer .btn-primary:hover,
#cart-drawer a.btn-primary:hover,
.menu-drawer-footer .btn-primary:hover,
.menu-drawer-footer a.btn-primary:hover,
.menu-drawer-footer .menu-cta:hover,
.menu-drawer-footer a.menu-cta:hover,
#menu-drawer .menu-cta:hover,
#menu-drawer a.menu-cta:hover,
a.menu-cta:hover {
  background-color: #774530 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(146, 90, 65, 0.25) !important;
}

.cart-drawer-footer .btn-ghost,
.cart-drawer-footer a.btn-ghost,
.cart-drawer-footer a.btn.btn-ghost,
#cart-drawer .btn-ghost,
#cart-drawer a.btn-ghost {
  background-color: transparent !important;
  color: #925a41 !important;
  border: 1.5px solid #925a41 !important;
  display: block !important;
  text-align: center !important;
  width: 100% !important;
  padding: 12px 24px !important;
  border-radius: var(--hm-radius-btn) !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  transition: all 0.25s ease !important;
  cursor: pointer !important;
  margin-top: 10px !important;
}

.cart-drawer-footer .btn-ghost:hover,
.cart-drawer-footer a.btn-ghost:hover,
.cart-drawer-footer a.btn.btn-ghost:hover,
#cart-drawer .btn-ghost:hover,
#cart-drawer a.btn-ghost:hover {
  background-color: #925a41 !important;
  color: #ffffff !important;
}

.cart-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f2f2f2;
}

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

.cart-item img,
.cart-item-img,
.cart-item-img-ph {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-img-ph {
  background: #eee;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary);
}

.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.qty-ctrl button {
  background: none;
  border: none;
  padding: 5px 12px;
  font-size: 16px;
  cursor: pointer;
  color: var(--primary);
}

.qty-ctrl button:hover {
  background: #f5f5f5;
}

.qty-ctrl span {
  padding: 0 8px;
  font-size: 15px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

#hm-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #333333;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 15px;
  z-index: 999999;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  font-family: var(--font-primary);
}

#hm-toast.show {
  transform: translateY(0);
  opacity: 1;
}
