/* =========================================================
   TRAKKY LAYOUT — header, footer, drawer, misc layout CSS
   ========================================================= */

/* ============ HEADER ============ */
.tk-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.header-logo .logo-mark {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-weight: 400;
}
.logo-mark { font-family: var(--font-display); font-size: 28px; color: var(--ink); }

.header-search { flex: 1; }
.header-search .search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream-2);
  border-radius: 999px;
  padding: 8px 14px;
  border: 1.5px solid transparent;
  transition: border-color .2s;
}
.header-search .search-form:focus-within { border-color: var(--ink); background: #fff; }
.header-search .search-field {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
}
.header-search .search-field::placeholder { color: var(--muted-2); }
.header-search .search-submit {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-soft);
  display: flex;
}
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: none;
  transition: background .2s;
  position: relative;
  cursor: pointer;
}
.header-action:hover { background: var(--cream-2); }
.header-action-label { display: none; }
@media (min-width: 992px) { .header-action-label { display: inline; } }

.cart-count {
  position: absolute;
  top: 2px;
  right: 4px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* --- Hamburger y elementos que sólo se ven en mobile --- */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  margin-right: 4px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 8px;
}
.mobile-menu-toggle:hover { background: var(--cream-2); }
.mobile-search-toggle { display: none; }
.mobile-search-bar {
  display: none;
  background: #fff;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  animation: mobileSearchIn .18s ease-out;
}
.mobile-search-bar.open { display: block; }
.mobile-search-bar form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream-2);
  border-radius: 999px;
  padding: 8px 14px;
}
.mobile-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
}
.mobile-search-bar button { background: none; border: none; color: var(--ink-soft); }
@keyframes mobileSearchIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 767px) {
  .header-inner { gap: 8px; padding: 10px 0; }
  .header-logo .logo-mark { font-size: 22px; }
  .header-search { display: none; }
  .header-action-account { display: none; }
  .mobile-menu-toggle,
  .mobile-search-toggle { display: inline-flex; }
  .header-action { padding: 8px; }
  .cart-toggle .header-action-label { display: none; }
}

/* --- Mobile off-canvas menu (drawer izquierdo) --- */
.mobile-menu-overlay {
  position: fixed; inset: 0;
  background: rgba(20,20,43,0.55);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 899;
}
.mobile-menu-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: 86%;
  max-width: 340px;
  height: 100vh;
  background: #fff;
  z-index: 900;
  transform: translateX(-100%);
  transition: transform .25s ease-out;
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.14);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  background: var(--ink); color: #fff;
}
.mobile-menu-head .logo-mark { color: #fff; font-size: 24px; }
.mobile-menu-head .drawer-close { color: #fff; font-size: 28px; }
.mobile-menu-account {
  padding: 14px 20px;
  background: var(--cream-2);
  border-bottom: 1px solid var(--line);
}
.mobile-menu-account a {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink);
}
.mobile-menu-account .mma-icon {
  width: 42px; height: 42px;
  border-radius: 999px;
  background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mobile-menu-account strong { display: block; font-size: 15px; }
.mobile-menu-account em { font-style: normal; font-size: 12px; color: var(--muted); }
.mobile-menu-nav { padding: 8px 0 24px; }
.mobile-menu-nav h4 {
  margin: 12px 20px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.mobile-menu-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu-nav li a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  color: var(--ink);
  font-size: 15px;
  border-bottom: 1px solid var(--line-2);
}
.mobile-menu-nav li a:hover { background: var(--cream-2); }
.mobile-menu-nav .mm-cat-icon { font-size: 20px; width: 24px; text-align: center; }
.mobile-menu-nav .mm-count {
  margin-left: auto;
  font-size: 12px; color: var(--muted-2);
  background: var(--cream-2);
  padding: 2px 8px;
  border-radius: 999px;
}

/* --- Bottom nav (5 items, mobile) --- */
.bottom-nav { display: none; }
@media (max-width: 767px) {
  .bottom-nav {
    display: block;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    z-index: 700;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  body { padding-bottom: 68px; }
}
.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
}
.bottom-nav-inner > a,
.bottom-nav-inner > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--ink);
  background: none;
  border: none;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  min-height: 60px;
}
.bottom-nav-inner > a.active { color: var(--orange); }
.bottom-nav-inner > a.active svg { stroke: var(--orange); }
.bottom-nav-inner .bn-wa {
  background: var(--wa, #25D366);
  color: #fff;
  border-radius: 50%;
  width: 56px; height: 56px;
  align-self: center;
  justify-self: center;
  margin-top: -18px;
  padding: 0;
  min-height: 0;
  box-shadow: 0 4px 14px rgba(37,211,102,0.4);
  border: 3px solid #fff;
}
.bottom-nav-inner .bn-wa svg { display: block; }
.cart-count-mobile {
  position: absolute;
  top: 4px; right: calc(50% - 22px);
  background: var(--orange);
  color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.cart-count-mobile:empty,
.cart-count-mobile[data-count="0"] { display: none; }

/* --- Botón flotante WhatsApp (desktop only) --- */
.wa-float {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--wa, #25D366);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(37,211,102,0.4);
  z-index: 500;
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); }
@media (max-width: 767px) { .wa-float { display: none; } }

/* ============ TRUST BAR ============ */
.trust-bar { background: var(--ink); color: #fff; padding: 40px 0; }
.trust-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 768px) { .trust-grid { grid-template-columns: repeat(4, 1fr); } }
.trust-item { display: flex; align-items: flex-start; gap: 14px; }
.trust-item strong { display: block; font-size: 14px; margin-bottom: 2px; }
.trust-item span { display: block; font-size: 12.5px; line-height: 1.4; color: rgba(255,255,255,.7); }
.trust-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.trust-wa { background: var(--wa); color: #fff; }
.trust-shield { background: var(--orange); color: #fff; }
.trust-truck { background: rgba(255,255,255,.14); color: #fff; }
.trust-return { background: rgba(255,255,255,.14); color: #fff; }

/* ============ FOOTER ============ */
.tk-footer { background: var(--ink-soft); color: rgba(255,255,255,.85); margin-top: 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 48px 0;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-brand .footer-mark { color: #fff; font-size: 30px; }
.footer-tagline { color: rgba(255,255,255,.6); font-size: 14px; line-height: 1.6; max-width: 280px; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background .2s;
}
.footer-social a:hover { background: var(--orange); }
.tk-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; }
.footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu li { margin-bottom: 10px; }
.footer-menu a { color: rgba(255,255,255,.7); font-size: 14px; transition: color .2s; }
.footer-menu a:hover { color: var(--orange); }
.payment-methods { list-style: none; margin: 0; padding: 0; }
.payment-methods li { color: rgba(255,255,255,.7); font-size: 14px; margin-bottom: 10px; }
.footer-bottom { background: var(--ink); padding: 18px 0; }
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; color: rgba(255,255,255,.5); font-size: 13px; }

/* ============ DRAWER ============ */
.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-header h3 { margin: 0; font-size: 17px; }
.drawer-close {
  background: none; border: none;
  font-size: 26px; line-height: 1;
  color: var(--muted);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-footer { padding: 16px 20px; border-top: 1px solid var(--line); }
.cart-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.cart-line:last-child { border-bottom: none; }
.cart-line img {
  width: 56px; height: 56px;
  object-fit: contain;
  background: var(--cream-2);
  border-radius: 8px;
  padding: 4px;
}
.cart-line .cl-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.cart-line .cl-meta { font-size: 12px; color: var(--muted); }
.cart-line .cl-total { font-size: 14px; font-weight: 600; white-space: nowrap; }
.cart-line .cl-remove {
  background: none; border: none;
  color: var(--danger); font-size: 18px; line-height: 1;
  padding: 0;
}
.cart-drawer-subtotal {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px;
  font-weight: 600;
}

/* ============ PAGE / CONTENT ============ */
.tk-page { padding: 24px 0 64px; }

/* ============ SKIP LINK ============ */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px; width: 1px;
  margin: -1px; overflow: hidden;
  padding: 0; position: absolute !important;
  word-wrap: normal !important;
}
.skip-link:focus {
  background: var(--ink); color: #fff;
  top: 5px; left: 5px;
  padding: 12px;
  clip: auto !important;
  clip-path: none;
  width: auto; height: auto;
  z-index: 100000;
  display: block;
  border-radius: var(--radius);
}
