/* ---------- TIPOGRAFÍAS ---------- */
  @font-face { font-family:'Fields'; src:url('../fonts/fields-black.otf') format('opentype'); font-weight:900; font-display:swap; }
  @font-face { font-family:'Montserrat'; src:url('../fonts/Montserrat-Regular.ttf') format('truetype'); font-weight:400; font-display:swap; }
  @font-face { font-family:'Montserrat'; src:url('../fonts/Montserrat-SemiBold.ttf') format('truetype'); font-weight:600; font-display:swap; }
  @font-face { font-family:'Montserrat'; src:url('../fonts/Montserrat-Bold.ttf') format('truetype'); font-weight:700; font-display:swap; }

  /* ---------- VARIABLES ---------- */
  :root {
    --green-primary: #3C8A4C;
    --green-light:   #ADCC54;
    --green-mid:     #699F4A;
    --green-dark:    #195852;
    --cream:         #E2E290;
    --purple:        #4B4281;
    --yellow:        #F2C43E;
    --ink:           #14201A;
    --muted:         #6B7670;
    --line:          #E8E9E4;
    --bg:            #FFFFFF;
    --bg-soft:       #FAFAF5;
    --maxw: 1280px;
    --pad:  clamp(20px, 4vw, 60px);
    --r:    14px;
    --shadow-sm:  0 1px 4px rgba(20,32,26,.06), 0 1px 2px rgba(20,32,26,.04);
    --shadow-md:  0 4px 20px rgba(20,32,26,.10), 0 2px 6px rgba(20,32,26,.06);
    --shadow-lg:  0 16px 48px rgba(20,32,26,.14), 0 4px 14px rgba(20,32,26,.08);
    --ease:       cubic-bezier(.4,0,.2,1);
  }

  /* ---------- RESET ---------- */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    color: var(--ink); background: var(--bg);
    font-size: 16px; line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }
  img { display: block; max-width: 100%; height: auto; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; cursor: pointer; border: none; background: none; }
  h1, h2, h3, h4 {
    font-family: 'Fields', Georgia, serif; font-weight: 900;
    line-height: 1.02; letter-spacing: -0.015em; color: var(--ink);
  }
  h1 { font-size: clamp(36px, 5vw, 64px); }
  h2 { font-size: clamp(28px, 4vw, 48px); }
  h3 { font-size: clamp(20px, 2.4vw, 28px); }
  .eyebrow {
    font-family:'Montserrat',sans-serif; font-weight:600;
    text-transform:uppercase; letter-spacing:.18em; font-size:12px;
    color: var(--green-primary);
  }
  .wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

  /* ---------- SCROLL REVEAL ---------- */
  [data-anim] { opacity: 0; transform: translateY(24px); transition: opacity .65s var(--ease), transform .65s var(--ease); }
  [data-anim].in { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) { [data-anim], [data-anim].in { opacity: 1 !important; transform: none !important; transition: none !important; } }

  /* ---------- UTILITY BAR ---------- */
  .utility {
    background: var(--green-dark); color: white;
    text-align: center; font-size: 12px; letter-spacing: .2em;
    padding: 10px var(--pad); text-transform: uppercase; font-weight: 600;
  }

  /* ---------- HEADER ---------- */
  header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.96);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .3s var(--ease), border-color .3s;
  }
  .scrolled header { box-shadow: var(--shadow-md); border-bottom-color: transparent; }
  .nav-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px var(--pad); max-width: var(--maxw); margin: 0 auto;
  }
  .logo-mark { display: flex; align-items: center; gap: 12px; }
  .logo-mark img { height: 44px; width: auto; display: block; }
  .logo-mark .word {
    font-family: 'Montserrat', sans-serif; font-weight: 700;
    font-size: 13px; letter-spacing: .04em; line-height: 1.1;
    color: var(--green-primary);
  }
  .logo-mark .word small {
    display: block; font-weight: 400; color: var(--muted);
    font-size: 9px; letter-spacing: .18em;
    text-transform: uppercase; margin-top: 2px;
  }
  nav.main { display: flex; gap: 36px; }
  nav.main a { font-size: 14px; font-weight: 500; color: var(--ink); transition: color .2s; }
  nav.main a:hover { color: var(--green-primary); }
  .header-actions { display: flex; align-items: center; gap: 14px; }
  .icon-btn {
    width: 40px; height: 40px; border-radius: 999px;
    display: grid; place-items: center; color: var(--ink);
    transition: background .2s; position: relative;
  }
  .icon-btn:hover { background: var(--bg-soft); }
  .icon-btn .badge {
    position: absolute; top: 4px; right: 4px;
    width: 16px; height: 16px; background: var(--green-primary);
    border-radius: 999px; color: white; font-size: 10px;
    display: grid; place-items: center; font-weight: 700;
  }
  .acct-wrap { position: relative; }
  .acct-btn {
    width: 38px; height: 38px; border-radius: 999px;
    display: grid; place-items: center; text-decoration: none;
    border: 1.5px solid var(--line); color: var(--muted);
    font-size: 14px; font-weight: 700;
    transition: background .2s, color .2s, border-color .2s;
  }
  .acct-btn svg { pointer-events: none; }
  .acct-btn .acct-initial { display: none; line-height: 1; }
  .acct-btn:hover { background: var(--bg-soft); color: var(--ink); border-color: var(--green-primary); }
  .acct-btn.logged { background: var(--green-primary); color: white; border-color: var(--green-primary); }
  .acct-btn.logged svg { display: none; }
  .acct-btn.logged .acct-initial { display: block; }
  .acct-drop {
    display: none; position: absolute; top: calc(100% + 10px); right: 0;
    background: #fff; border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: var(--shadow-md); min-width: 190px; z-index: 200;
    overflow: hidden;
  }
  .acct-drop.open { display: block; }
  .acct-drop-name {
    padding: 12px 16px 10px; font-size: 13px; font-weight: 600;
    color: var(--muted); border-bottom: 1px solid var(--line);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .acct-drop-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--ink);
    width: 100%; text-align: left; background: none; border: none;
    cursor: pointer; text-decoration: none;
    transition: background .15s;
  }
  .acct-drop-item:hover { background: var(--bg-soft); }
  .acct-drop-item svg { flex-shrink: 0; color: var(--muted); }
  .acct-drop-logout { color: #c0392b; border-top: 1px solid var(--line); }
  .acct-drop-logout svg { color: #c0392b; }
  .btn-wa {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--green-primary); color: white;
    padding: 11px 18px; border-radius: 999px;
    font-size: 13px; font-weight: 600;
    transition: background .2s, transform .22s var(--ease), box-shadow .22s var(--ease);
  }
  .btn-wa:hover { background: #2d6e3a; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(60,138,76,.32); }
  .btn-wa svg { width: 16px; height: 16px; flex-shrink: 0; }

  /* ---------- HAMBURGER ---------- */
  .hamburger {
    display: none; flex-direction: column; justify-content: center;
    align-items: center; gap: 5px;
    width: 40px; height: 40px; padding: 9px;
    border-radius: 8px; transition: background .2s;
  }
  .hamburger:hover { background: var(--bg-soft); }
  .hamburger span {
    display: block; width: 22px; height: 2px;
    background: var(--ink); border-radius: 2px;
    transform-origin: center;
    transition: transform .3s var(--ease), opacity .25s, width .3s var(--ease);
  }
  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ---------- MOBILE NAV ---------- */
  .mobile-nav {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(340px, 88vw); background: var(--bg);
    z-index: 200; padding: 24px 32px 40px;
    transform: translateX(110%);
    transition: transform .38s var(--ease);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }
  .mobile-nav.open { transform: translateX(0); }
  .close-nav {
    align-self: flex-end; width: 40px; height: 40px;
    border-radius: 999px; display: grid; place-items: center;
    color: var(--muted); margin-bottom: 28px; margin-right: -8px;
    transition: background .2s, color .2s;
  }
  .close-nav:hover { background: var(--bg-soft); color: var(--ink); }
  .mob-links { display: flex; flex-direction: column; flex: 1; }
  .mob-link {
    font-family: 'Fields', serif; font-weight: 900;
    font-size: clamp(26px, 6vw, 32px); color: var(--ink);
    padding: 16px 0; border-bottom: 1px solid var(--line);
    transition: color .2s, padding-left .22s var(--ease);
    display: block;
  }
  .mob-link:last-child { border-bottom: none; }
  .mob-link:hover { color: var(--green-primary); padding-left: 8px; }
  .mob-wa {
    margin-top: 28px; justify-content: center;
    width: 100%; font-size: 15px; padding: 14px 20px;
  }
  .nav-overlay {
    position: fixed; inset: 0;
    background: rgba(20,32,26,.45);
    z-index: 190; opacity: 0; pointer-events: none;
    transition: opacity .38s;
    backdrop-filter: blur(2px);
  }
  .nav-overlay.open { opacity: 1; pointer-events: auto; }

  /* ---------- MINI CARRITO DROPDOWN ---------- */
  .cart-wrap { position: relative; }
  .cart-drop {
    position: absolute; top: calc(100% + 10px); right: 0;
    width: 290px; background: white;
    border-radius: 16px; box-shadow: var(--shadow-lg);
    border: 1px solid var(--line); padding: 16px;
    opacity: 0; pointer-events: none;
    transform: translateY(8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease);
    z-index: 200;
  }
  .cart-drop.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .cart-drop::before {
    content: ''; position: absolute; top: -6px; right: 14px;
    width: 12px; height: 12px; background: white;
    border-left: 1px solid var(--line); border-top: 1px solid var(--line);
    transform: rotate(45deg);
  }
  .cart-drop-items { max-height: 220px; overflow-y: auto; }
  .cart-drop-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .cart-drop-item:last-child { border-bottom: none; }
  .cart-drop-thumb { width: 46px; height: 46px; border-radius: 8px; background: var(--bg-soft); background-size: cover; background-position: center; flex-shrink: 0; }
  .cart-drop-info { flex: 1; min-width: 0; }
  .cart-drop-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cart-drop-qty  { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .cart-drop-empty { text-align: center; padding: 24px 0; color: var(--muted); font-size: 13px; }
  .cart-drop-footer { margin-top: 14px; border-top: 2px solid var(--line); padding-top: 12px; }
  .cart-drop-total { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 12px; }
  .cart-drop-total strong { color: var(--ink); }
  .cart-drop-total .amt { font-weight: 700; color: var(--green-primary); }
  .cart-drop-go { display: block; text-align: center; background: var(--green-primary); color: white; padding: 11px; border-radius: 999px; font-size: 13px; font-weight: 700; transition: background .2s; }
  .cart-drop-go:hover { background: var(--green-mid); }
  @media (max-width: 560px) {
    .cart-drop { width: 230px; padding: 12px; right: -8px; }
    .cart-drop-name { font-size: 12px; }
    .cart-drop-thumb { width: 38px; height: 38px; }
  }

  /* ---------- BUTTONS ---------- */
  .btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 28px; border-radius: 999px;
    font-weight: 600; font-size: 14px; font-family: inherit;
    transition: transform .22s var(--ease), background .2s, color .2s, box-shadow .22s var(--ease);
    cursor: pointer;
  }
  .btn-primary { background: var(--green-primary); color: white; border: none; }
  .btn-primary:hover { background: #2d6e3a; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(60,138,76,.32); }
  .btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
  .btn-outline:hover { border-color: var(--ink); }

  /* ---------- FOOTER ---------- */
  footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 80px 0 30px; }
  .footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 50px;
    padding-bottom: 50px; border-bottom: 1px solid rgba(255,255,255,.1);
  }
  footer h4 {
    color: white; font-family: 'Montserrat', sans-serif; font-weight: 600;
    font-size: 13px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 18px;
  }
  footer ul { list-style: none; }
  footer li { margin-bottom: 10px; font-size: 14px; }
  footer a { transition: color .2s; }
  footer a:hover { color: white; }
  .foot-brand { color: rgba(255,255,255,.85); }
  .foot-brand .logo-mark img { filter: brightness(0) invert(1); }
  .foot-brand .logo-mark .word { color: white; }
  .foot-brand .logo-mark .word small { color: rgba(255,255,255,.5); }
  .foot-brand p { font-size: 14px; max-width: 32ch; margin-top: 18px; line-height: 1.6; }
  .foot-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 24px; font-size: 12px; color: rgba(255,255,255,.4);
    flex-wrap: wrap; gap: 14px;
  }
  .socials { display: flex; gap: 14px; }
  .socials a { font-size: 13px; }

  /* ============================= */
  /* ===== CART PAGE STYLES ====== */
  /* ============================= */

  .page-hero {
    background: var(--bg-soft);
    padding: clamp(36px, 5vw, 60px) 0 clamp(28px, 4vw, 48px);
    border-bottom: 1px solid var(--line);
  }
  .breadcrumb {
    font-size: 13px; color: var(--muted); margin-bottom: 16px;
  }
  .breadcrumb a { color: var(--green-primary); }
  .breadcrumb a:hover { text-decoration: underline; }
  .breadcrumb span { color: var(--muted); }

  .cart-page-wrap { padding: clamp(40px, 6vw, 80px) 0 clamp(60px, 8vw, 100px); }

  /* Empty state */
  .cart-empty {
    text-align: center; padding: clamp(60px, 8vw, 100px) 0;
  }
  .cart-empty-icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--bg-soft); display: grid; place-items: center;
    margin: 0 auto 24px; color: var(--muted);
  }
  .cart-empty h2 { margin-bottom: 12px; font-size: clamp(26px, 3vw, 36px); }
  .cart-empty p { color: var(--muted); font-size: 16px; margin-bottom: 32px; max-width: 40ch; margin-left: auto; margin-right: auto; }

  /* Cart layout */
  .cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 52px;
    align-items: start;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Items column */
  .cart-items-col { min-width: 0; }
  .cart-items-head {
    display: grid;
    grid-template-columns: 80px 1fr 120px 110px 88px 36px;
    gap: 16px; align-items: center;
    padding: 0 0 14px;
    border-bottom: 2px solid var(--ink);
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em;
    color: var(--muted);
  }
  .cart-items-head .col-prod { grid-column: 1 / 3; }
  .cart-items-head .col-price { text-align: center; }
  .cart-items-head .col-qty { text-align: center; }
  .cart-items-head .col-sub { text-align: right; }

  /* Cart item — desktop: 6 columnas */
  .cart-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 110px 88px 36px;
    gap: 16px; align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
  }
  /* ci-bottom-row transparente en desktop: sus hijos son celdas directas del grid */
  .ci-bottom-row { display: contents; }

  .ci-thumb {
    width: 64px; height: 64px; flex-shrink: 0;
    border-radius: 10px; background: var(--bg-soft);
    background-size: cover; background-position: center;
    border: 1px solid var(--line);
  }
  .ci-info { min-width: 0; }
  .ci-name {
    font-family: 'Fields', serif; font-weight: 900;
    font-size: 16px; line-height: 1.1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 4px;
  }
  .ci-sub-label { font-size: 12px; color: var(--muted); }

  .ci-price { text-align: center; font-size: 13px; font-weight: 600; line-height: 1.3; }
  .ci-price-bs { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 3px; }

  .ci-qty { display: flex; align-items: center; justify-content: center; gap: 8px; }
  .qty-btn {
    width: 28px; height: 28px; border-radius: 999px;
    background: var(--bg-soft); color: var(--ink);
    display: grid; place-items: center;
    font-size: 16px; font-weight: 700; line-height: 1;
    transition: background .2s; flex-shrink: 0;
  }
  .qty-btn:hover { background: var(--line); }
  .qty-num { font-size: 15px; font-weight: 600; min-width: 20px; text-align: center; }

  .ci-subtotal { text-align: right; font-size: 13px; font-weight: 700; color: var(--green-primary); }

  .ci-remove {
    width: 32px; height: 32px; border-radius: 999px;
    display: grid; place-items: center; color: var(--muted);
    transition: background .2s, color .2s; flex-shrink: 0;
  }
  .ci-remove:hover { background: #fee2e2; color: #dc2626; }

  /* Summary box */
  .summary-col { position: sticky; top: 90px; }
  .summary-box {
    background: white; border: 1px solid var(--line);
    border-radius: var(--r); padding: 28px 24px;
    box-shadow: var(--shadow-sm);
  }
  .summary-box h3 {
    font-size: 18px; margin-bottom: 20px;
    padding-bottom: 16px; border-bottom: 1px solid var(--line);
  }
  .summary-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 8px 0; font-size: 14px; color: var(--muted);
  }
  .summary-row.total {
    margin-top: 8px; padding-top: 16px;
    border-top: 2px solid var(--ink);
    font-size: 16px; font-weight: 700; color: var(--ink);
  }
  .summary-row.total .val { color: var(--green-primary); font-size: 20px; }
  .summary-row .val { font-weight: 600; color: var(--ink); }
  .summary-bcv { font-size: 12px; color: var(--muted); margin: 4px 0 20px; line-height: 1.4; }
  .summary-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
  .btn-checkout {
    display: block; text-align: center;
    background: var(--ink); color: white;
    padding: 16px 20px; border-radius: 999px;
    font-size: 15px; font-weight: 700; font-family: inherit;
    border: none; cursor: pointer; width: 100%;
    transition: background .2s, transform .22s var(--ease);
  }
  .btn-checkout:hover { background: var(--green-dark); transform: translateY(-1px); }
  .btn-keep-buying {
    display: block; text-align: center;
    background: transparent; color: var(--muted);
    padding: 12px 20px; border-radius: 999px;
    font-size: 14px; font-weight: 500; font-family: inherit;
    border: 1px solid var(--line); cursor: pointer; width: 100%;
    transition: border-color .2s, color .2s;
  }
  .btn-keep-buying:hover { border-color: var(--muted); color: var(--ink); }
  .secure-note {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    margin-top: 16px; font-size: 12px; color: var(--muted);
  }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 980px) {
    nav.main { display: none; }
    .hamburger { display: flex; }
    .header-actions .btn-wa { display: none; }
    .icon-search { display: none; }
    .header-actions { gap: 8px; }
    .cart-layout { grid-template-columns: 1fr; }
    .summary-col { position: static; }
    .cart-items-head { display: none; }

    /* Item: imagen | nombre + fila de precio/qty/subtotal | eliminar */
    .cart-item {
      display: grid;
      grid-template-columns: 60px 1fr 44px;
      grid-template-rows: auto auto;
      column-gap: 14px; row-gap: 6px;
      padding: 20px 0;
      align-items: start;
    }
    .ci-product {
      grid-column: 1 / 2;
      grid-row: 1 / 3;
      align-self: center;
    }
    .ci-thumb { width: 56px; height: 56px; border-radius: 8px; }
    .ci-info {
      grid-column: 2 / 3;
      grid-row: 1;
    }
    .ci-name { font-size: 14px; white-space: normal; margin-bottom: 0; }
    .ci-sub-label { display: none; }

    /* Fila 2: precio · qty · subtotal */
    .ci-bottom-row {
      grid-column: 2 / 3;
      grid-row: 2;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .ci-price { text-align: left; font-size: 12px; flex-shrink: 0; line-height: 1.2; }
    .ci-price-bs { font-size: 9px; margin-top: 1px; }
    .ci-qty { justify-content: flex-start; flex-shrink: 0; gap: 4px; }
    /* Botones qty: 36px visual, touch-action para reducir delay */
    .qty-btn {
      width: 36px; height: 36px; font-size: 16px;
      touch-action: manipulation;
    }
    .qty-num { font-size: 13px; min-width: 16px; }
    .ci-subtotal { font-size: 13px; font-weight: 700; margin-left: auto; text-align: right; flex-shrink: 0; }

    /* Botón eliminar: 44px área táctil */
    .ci-remove {
      grid-column: 3 / 4;
      grid-row: 1 / 3;
      align-self: center;
      width: 44px; height: 44px;
      border-radius: 999px;
      touch-action: manipulation;
    }
  }

  @media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
    .utility { font-size: 10px; letter-spacing: .12em; }
    .logo-mark .word { display: none; }
    .cart-item { grid-template-columns: 56px 1fr 44px; column-gap: 12px; }
    .ci-thumb { width: 56px; height: 56px; }
    .ci-name { font-size: 13px; }
    .qty-btn { width: 34px; height: 34px; }
    .wrap { padding-left: 24px; padding-right: 24px; }
    .cart-page-wrap { padding-top: 28px; }
  }
