/* =============================================================================
   Marketplace — hoja de estilos
   Sin frameworks: un único fichero, cacheable y ligero.

   Rediseño 2026: interfaz orientada al comprador. Menos cromo, más aire,
   tipografía más grande y una sola acción principal por pantalla.
   ========================================================================== */

:root {
    --brand:        #4f46e5;
    --brand-dark:   #4338ca;
    --brand-light:  #eef1ff;
    --brand-soft:   #f6f7ff;

    --sell:         #0f9f7a;   /* acciones de "vender": verde, distinto del azul de comprar */
    --sell-dark:    #0b8265;
    --sell-light:   #e8f8f2;

    --ink:          #0f1420;
    --ink-soft:     #4b5565;
    --muted:        #737d8c;
    --line:         #e7e9ee;
    --line-soft:    #f1f2f6;
    --bg:           #ffffff;
    --bg-soft:      #f6f7f9;
    --surface:      #ffffff;

    --ok:           #067a55;
    --ok-bg:        #e8f8f2;
    --warn:         #a15c07;
    --warn-bg:      #fff7e8;
    --danger:       #d3372b;
    --danger-bg:    #fdf0ef;
    --info-bg:      #eef4ff;
    --info:         #1d4ed8;

    --radius-sm:    10px;
    --radius:       14px;
    --radius-lg:    20px;
    --shadow:       0 1px 2px rgba(15,20,32,.05);
    --shadow-md:    0 4px 14px -4px rgba(15,20,32,.12);
    --shadow-lg:    0 18px 40px -18px rgba(15,20,32,.28);
    --maxw:         1240px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }
.tiny { max-width: 480px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xs { font-size: .78rem; }
.bold { font-weight: 600; }
.h4 { font-size: 1.05rem; margin: 0 0 .75rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; } .mt1 { margin-top: .5rem; } .mt2 { margin-top: 1rem; }
.mt3 { margin-top: 1.5rem; } .mt4 { margin-top: 2.5rem; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: .5rem; } .mb2 { margin-bottom: 1rem; }
.mb3 { margin-bottom: 1.5rem; }

/* ---------------------------------------------------------------- Cabecera
   Tres cosas y nada más: marca, buscador y las dos acciones que importan
   (vender y carrito). Sin "acceder" ni "registrarse": comprar no lo pide. */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.header-main {
    display: flex; align-items: center; gap: 22px;
    padding: 14px 0;
}
.logo {
    display: flex; align-items: center; gap: 11px;
    font-weight: 800; font-size: 1.3rem; color: var(--ink);
    letter-spacing: -.035em; text-decoration: none; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-mark {
    display: grid; place-items: center; flex-shrink: 0;
    width: 40px; height: 40px; border-radius: 13px;
    background: var(--brand);
    transition: transform .15s;
}
.logo-mark svg { width: 21px; height: 21px; }
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.04); }
.logo-text { line-height: 1.05; white-space: nowrap; }
.logo-accent { color: var(--brand); }

.search-form { flex: 1; display: flex; max-width: 620px; position: relative; }
.search-form input {
    flex: 1; border: 1px solid var(--line); border-radius: 999px;
    padding: 12px 118px 12px 44px; font-size: .95rem;
    background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23737d8c' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.2-3.2'/%3E%3C/svg%3E") no-repeat 16px center;
    min-width: 0; transition: background-color .15s, border-color .15s;
}
.search-form input:focus {
    outline: none; border-color: var(--brand); background-color: #fff;
    box-shadow: 0 0 0 4px var(--brand-light);
}
.search-form button {
    position: absolute; right: 5px; top: 5px; bottom: 5px;
    border: 0; background: var(--brand); color: #fff; padding: 0 22px;
    border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem;
    font-family: inherit;
}
.search-form button:hover { background: var(--brand-dark); }

.header-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-nav a, .header-nav button {
    color: var(--ink-soft); font-size: .92rem; padding: 9px 12px; font-weight: 500;
    border-radius: 10px; background: none; border: 0; cursor: pointer;
    font-family: inherit; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
}
.header-nav a:hover, .header-nav button:hover { background: var(--bg-soft); text-decoration: none; color: var(--ink); }

/* Botón «Quiero vender»: siempre visible, en verde, para no competir con el
   azul de comprar y que se distinga de un vistazo. */
.header-nav .btn-sell {
    background: var(--sell); color: #fff; font-weight: 600; padding: 10px 18px;
    border-radius: 999px;
}
.header-nav .btn-sell:hover { background: var(--sell-dark); color: #fff; }

.icon-link {
    position: relative; width: 42px; height: 42px; padding: 0 !important;
    justify-content: center; font-size: 1.15rem; border-radius: 50% !important;
}
.cart-link { position: relative; }
.cart-badge {
    position: absolute; top: 2px; right: 0;
    background: var(--danger); color: #fff; font-size: .66rem; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff;
}

/* Tira de categorías: sólo categorías, nada de seis grupos de filtros.
   Los filtros finos viven en el catálogo, que es donde se usan. */
.cat-bar { border-top: 1px solid var(--line-soft); background: var(--surface); }
.cat-bar-inner {
    display: flex; gap: 6px; overflow-x: auto; padding: 10px 0;
    scrollbar-width: none; align-items: center;
}
.cat-bar-inner::-webkit-scrollbar { display: none; }
.cat-bar-inner a {
    color: var(--ink-soft); font-size: .9rem; padding: 7px 14px; font-weight: 500;
    border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.cat-bar-inner a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.cat-bar-inner a.active { background: var(--ink); color: #fff; }
.cat-bar-inner .cat-bar-label {
    color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; padding-right: 4px; white-space: nowrap; align-self: center;
}
.cat-bar-inner .cat-bar-group {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.bar-select {
    border: 1px solid var(--line); background-color: #fff; color: var(--ink-soft);
    font-size: .86rem; padding: 7px 30px 7px 12px; border-radius: 999px;
    width: auto; max-width: 190px;
}
.bar-select:hover { border-color: #cfd4de; }
.bar-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }

/* ------------------------------------------------------------------ Botones */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--brand); color: #fff; border: 1px solid var(--brand);
    padding: 11px 20px; border-radius: 999px; font-size: .95rem; font-weight: 600;
    cursor: pointer; font-family: inherit; text-decoration: none; line-height: 1.4;
    transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); border-color: #cfd4de; }
.btn-sell-cta { background: var(--sell); border-color: var(--sell); }
.btn-sell-cta:hover { background: var(--sell-dark); border-color: var(--sell-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b12b21; border-color: #b12b21; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-block { width: 100%; }

.link-btn {
    background: none; border: 0; color: var(--brand); cursor: pointer;
    font: inherit; font-size: .875rem; padding: 0; text-decoration: underline;
}
.link-danger { color: var(--danger); }

/* ------------------------------------------------------------------ Tarjetas */
.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 24px;
}
.card + .card { margin-top: 20px; }
.card-tight { padding: 18px; }
.card-soft { background: var(--bg-soft); border-color: transparent; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.products-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 22px 18px; }

/* ------------------------------------------------------- Tarjeta de producto
   Sin marco: la foto manda y el texto respira. Es lo que hace que una rejilla
   de 20 artículos se lea como un escaparate y no como una tabla. */
.product-card {
    background: transparent; border: 0;
    border-radius: var(--radius); overflow: visible;
    display: flex; flex-direction: column;
}
.product-card a { text-decoration: none; color: inherit; }

.product-thumb {
    aspect-ratio: 1; background: var(--bg-soft); position: relative; overflow: hidden;
    border-radius: var(--radius); border: 1px solid var(--line-soft);
    transition: transform .2s ease, box-shadow .2s ease;
}
.product-card:hover .product-thumb { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .placeholder {
    width: 100%; height: 100%; display: grid; place-items: center;
    color: #c3c8d2; font-size: 2.2rem;
}
.product-body { padding: 11px 2px 0; display: flex; flex-direction: column; flex: 1; }
.product-title {
    font-size: .95rem; font-weight: 600; line-height: 1.35; margin: 0 0 3px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card:hover .product-title { color: var(--brand); }
.product-shop { font-size: .78rem; color: var(--muted); margin-bottom: 7px; }
.product-shop a { color: var(--muted); }
.product-shop a:hover { color: var(--brand); }
.product-foot { margin-top: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font-size: 1.1rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.price-old { font-size: .82rem; color: var(--muted); text-decoration: line-through; }
.rating { font-size: .78rem; color: #d98207; }

.badge {
    display: inline-block; font-size: .69rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; padding: 4px 8px; border-radius: 7px;
    background: var(--bg-soft); color: var(--ink-soft);
}
.badge-brand  { background: var(--brand-light); color: var(--brand-dark); }
.badge-ok     { background: var(--ok-bg);     color: var(--ok); }
.badge-warn   { background: var(--warn-bg);   color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info   { background: var(--info-bg);   color: var(--info); }
.thumb-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; flex-wrap: wrap; }
.thumb-badges .badge { box-shadow: var(--shadow); }

/* ------------------------------------------------------------------- Avisos */
.alert {
    border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px;
    font-size: .92rem; border: 1px solid transparent;
}
.alert-success { background: var(--ok-bg);     color: #056042; border-color: #b7e8d5; }
.alert-error   { background: var(--danger-bg); color: #96251c; border-color: #f7cdc9; }
.alert-warning { background: var(--warn-bg);   color: #8a4f06; border-color: #fbe3b6; }
.alert-info    { background: var(--info-bg);   color: #1e40af; border-color: #cbdcfd; }

/* ----------------------------------------------------------------- Formularios */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.field .hint { font-size: .79rem; color: var(--muted); margin-top: 6px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=tel], input[type=url], select, textarea {
    width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px; font: inherit; font-size: .95rem; background: #fff; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23737d8c' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input[type=file] {
    font-size: .88rem; padding: 14px; background: var(--bg-soft);
    border: 1px dashed var(--line); border-radius: var(--radius-sm); width: 100%;
}

.check { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; }
.check input { margin-top: 3px; flex-shrink: 0; }
.check label { font-weight: 400; margin: 0; color: var(--ink); }

.form-row { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.form-row-3 { display: grid; gap: 18px; grid-template-columns: 1fr 1fr 1fr; }

.input-suffix { position: relative; }
.input-suffix input { padding-right: 44px; }
.input-suffix span {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: .9rem; pointer-events: none;
}

/* Selector de opción en tarjeta (radio grande, tipo «elige una vía»). */
.pick { display: grid; gap: 12px; }
.pick label {
    display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
    font-weight: 500; transition: border-color .15s, background .15s;
}
.pick label:hover { border-color: #cfd4de; }
.pick input { margin-top: 3px; accent-color: var(--brand); }
.pick input:checked + span { color: var(--ink); }
.pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pick .t { display: block; font-weight: 600; }
.pick .d { display: block; font-size: .84rem; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ------------------------------------------------------------------- Tablas */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
    text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 700; padding: 11px 12px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-soft); }
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }

/* ---------------------------------------------------------- Panel / sidebar */
.panel-layout { display: grid; grid-template-columns: 240px 1fr; gap: 30px; align-items: start; }
.panel-nav {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 10px; position: sticky; top: 92px;
}
.panel-nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 13px;
    border-radius: var(--radius-sm); color: var(--ink-soft); font-size: .92rem; font-weight: 500;
}
.panel-nav a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.panel-nav a.active { background: var(--ink); color: #fff; font-weight: 600; }
.panel-nav .nav-sep { height: 1px; background: var(--line); margin: 8px 12px; }
.panel-nav .nav-title {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 700; padding: 11px 13px 5px;
}

/* ---------------------------------------------------------------- Métricas */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 20px;
}
.stat .label { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .045em; font-weight: 600; }
.stat .value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; }
.stat .sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.stat.accent { background: var(--ink); border-color: transparent; color: #fff; }
.stat.accent .label, .stat.accent .sub { color: rgba(255,255,255,.7); }

/* ------------------------------------------------------------------- Hero
   La portada es un escaparate, no un cartel: el hero es una franja fina que
   no empuja los productos por debajo del pliegue. */
.hero {
    background: var(--bg-soft);
    color: var(--ink); padding: 30px 0; margin-bottom: 34px;
    border-bottom: 1px solid var(--line-soft);
}
.hero h1 { font-size: 1.7rem; margin-bottom: .25em; }
.hero p { font-size: .98rem; color: var(--ink-soft); max-width: 640px; margin-bottom: 16px; }
.hero .btn-ghost { background: #fff; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-white { background: var(--ink); color: #fff; border-color: var(--ink); }
.hero-white:hover { background: #000; color: #fff; border-color: #000; }

.section { margin-bottom: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head .small { font-weight: 600; white-space: nowrap; }

/* ------------------------------------------------------------- Categorías
   Iconos grandes dentro de un círculo de color suave: es la parte de la
   portada que más se toca en móvil y necesita blanco de seguridad. */
.cat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.cat-tile {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 24px 14px 20px; text-align: center; color: var(--ink);
    transition: transform .16s, box-shadow .16s, border-color .16s;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.cat-tile:hover {
    border-color: transparent; text-decoration: none;
    transform: translateY(-3px); box-shadow: var(--shadow-md);
}
.cat-tile .ico {
    font-size: 2.6rem; line-height: 1; margin-bottom: 12px;
    width: 78px; height: 78px; border-radius: 50%;
    background: var(--brand-soft);
    display: grid; place-items: center;
    transition: background .16s, transform .16s;
}
.cat-tile:hover .ico { background: var(--brand-light); transform: scale(1.05); }
.cat-tile .name { font-size: .95rem; font-weight: 600; }
.cat-tile .count { font-size: .78rem; color: var(--muted); }

/* --------------------------------------------------------- Ficha producto */
.product-detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 46px; align-items: start; }
.gallery-main {
    aspect-ratio: 1; background: var(--bg-soft); border-radius: var(--radius-lg);
    overflow: hidden; border: 1px solid var(--line-soft);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs button {
    width: 70px; height: 70px; border-radius: var(--radius-sm); border: 2px solid var(--line);
    overflow: hidden; padding: 0; cursor: pointer; background: var(--bg-soft);
}
.gallery-thumbs button.active { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.price-big { font-size: 2.3rem; font-weight: 800; letter-spacing: -.035em; }
.buy-box {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 22px; margin-top: 22px;
    box-shadow: var(--shadow);
}
.qty-row { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.qty-row input { width: 88px; }

.spec-list { list-style: none; padding: 0; margin: 18px 0 0; font-size: .92rem; }
.spec-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.spec-list li:last-child { border-bottom: 0; }
.spec-list .k { color: var(--muted); }

.breadcrumb { font-size: .84rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 6px; opacity: .5; }

.prose { line-height: 1.75; }
.prose p { margin-bottom: 1em; }

/* ------------------------------------------------------------------ Reseñas */
.review { padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-author { font-weight: 600; font-size: .9rem; }
.dist-row { display: flex; align-items: center; gap: 10px; font-size: .82rem; margin-bottom: 5px; }
.dist-bar { flex: 1; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: #f0a422; }

/* ------------------------------------------------------------------ Carrito */
.cart-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 22px; overflow: hidden; }
.cart-group-head {
    padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--bg-soft);
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.cart-item { display: flex; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.cart-item:last-of-type { border-bottom: 0; }
.cart-item-img { width: 84px; height: 84px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-soft); flex-shrink: 0; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-group-foot { padding: 18px 22px; background: var(--bg-soft); border-top: 1px solid var(--line); }
.totals { font-size: .93rem; }
.totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .grand { font-size: 1.15rem; font-weight: 700; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 11px; }

/* -------------------------------------------------------------- Paginación */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line);
    background: #fff; color: var(--ink-soft); font-size: .89rem;
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------------------------------------------------------------- Filtros */
.catalog-layout { display: grid; grid-template-columns: 245px 1fr; gap: 34px; align-items: start; }
.filters {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 20px; position: sticky; top: 92px;
}
.filters h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 22px 0 10px; }
.filters h3:first-child { margin-top: 0; }
.filters ul { list-style: none; padding: 0; margin: 0; }
.filters li a {
    display: block; padding: 7px 10px; font-size: .89rem; color: var(--ink-soft);
    border-radius: 8px; margin: 0 -6px;
}
.filters li a:hover { background: var(--bg-soft); text-decoration: none; color: var(--ink); }
.filters li a.active { color: #fff; background: var(--ink); font-weight: 600; }
.filters li a.active .muted { color: rgba(255,255,255,.65); }

/* Filtros plegables en móvil: en un teléfono la columna de filtros es lo
   primero que ve el usuario y le tapa los productos, así que se pliega. */
.filters-toggle { display: none; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar select { width: auto; min-width: 190px; }

/* ------------------------------------------------------------------ Planes */
.plans { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: stretch; }
.plan {
    background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-lg);
    padding: 30px 26px; display: flex; flex-direction: column; position: relative;
    transition: box-shadow .18s, border-color .18s;
}
.plan:hover { box-shadow: var(--shadow-md); }
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow-md); }
.plan .tag {
    position: absolute; top: -13px; left: 26px;
    background: var(--ink); color: #fff; font-size: .7rem; font-weight: 700;
    padding: 5px 14px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em;
    white-space: nowrap;
}
.plan.featured .tag { background: var(--brand); }
.plan .plan-ico {
    width: 58px; height: 58px; border-radius: 18px; background: var(--bg-soft);
    display: grid; place-items: center; font-size: 1.8rem; margin-bottom: 16px;
}
.plan h3 { font-size: 1.28rem; margin-bottom: 6px; }
.plan .amount { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; }
.plan .amount small { font-size: .88rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .commission-line {
    background: var(--bg-soft); color: var(--ink-soft); border-radius: var(--radius-sm);
    padding: 12px 16px; font-weight: 500; margin: 16px 0; font-size: .9rem;
}
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; font-size: .92rem; flex: 1; }
.plan li { padding: 7px 0 7px 27px; position: relative; color: var(--ink-soft); }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan li.no::before { content: "—"; color: var(--muted); }

/* Precio de referencia tachado + promoción de cuota gratis.
   Jerarquía deliberada, de menos a más peso visual:
     1. Los planes de pago se VEN (transparencia) pero tachados y en gris:
        son la referencia, no lo que se pide mirar.
     2. La promoción de cuota gratis es la pieza más grande y con más
        contraste de toda la tarjeta: fondo sólido en el verde de "vender".
     3. «Ver condiciones» es una nota al pie, pequeña y discreta a propósito. */
.price-promo {
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    margin: 16px 0 18px; background: #fff;
}
.price-old-rows { padding: 14px 16px 4px; }
.price-old-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.price-old-row:last-child { border-bottom: 0; }
.price-old-row .plan-name { font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.price-old-row .plan-detail { display: block; font-size: .74rem; color: var(--muted); margin-top: 1px; }
.price-old-row .plan-was {
    font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap;
    color: var(--muted);
    text-decoration: line-through; text-decoration-color: var(--danger); text-decoration-thickness: 2px;
}
.price-old-row .plan-was small { font-size: .62rem; font-weight: 600; text-decoration: none; }

.price-free {
    background: var(--sell); color: #fff; text-align: center;
    padding: 16px 18px 15px; margin: 14px 8px 0;
    border-radius: var(--radius-sm);
}
.price-free-headline { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.price-free-sub { font-size: .84rem; font-weight: 600; opacity: .92; margin-top: 3px; }

.price-terms-link { text-align: center; margin: 8px 0 10px; }
.price-terms-link a { font-size: .72rem; color: var(--muted); }

/* ------------------------------------------------- Landing de campaña (/lanzamiento)
   Página de entrada desde fuera (Chollometro, LinkedIn). Reutiliza la tarjeta
   de precio de /vender para que quien pulse «Quiero vender» vea exactamente lo
   mismo que le prometió el anuncio. */
.lp-hero {
    background: var(--bg-soft); border-bottom: 1px solid var(--line);
    padding: 46px 0 52px; margin: -24px 0 44px;
    margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
    padding-left: 20px; padding-right: 20px;
}
.lp-hero-grid {
    display: grid; grid-template-columns: 1.08fr .92fr; gap: 52px; align-items: center;
}
.lp-eyebrow {
    display: inline-block; background: var(--sell); color: #fff;
    font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
    padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}

/* Distintivo de «Lanzamiento en diciembre». Va en oscuro, no en el verde de
   vender: es un dato de calendario, no una llamada a la acción, y compitiendo
   en color le robaría atención al bloque de la cuota gratis. */
.launch-chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--ink); color: #fff;
    font-size: .76rem; font-weight: 700; letter-spacing: .04em;
    padding: 7px 16px; border-radius: 999px; margin-bottom: 18px;
}

/* Línea de tiempo: ahora → diciembre → después. El paso del lanzamiento va
   resaltado porque es el que explica la urgencia. */
.lp-timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-step {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 22px;
}
.lp-step-when {
    font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
    color: var(--muted); margin-bottom: 8px;
}
.lp-step-what { font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.lp-step p { font-size: .88rem; color: var(--muted); margin: 0; line-height: 1.55; }
.lp-step-key { background: var(--ink); border-color: var(--ink); color: #fff; }
.lp-step-key .lp-step-when { color: rgba(255,255,255,.6); }
.lp-step-key p { color: rgba(255,255,255,.8); }
.lp-h1 { font-size: 2.7rem; line-height: 1.08; letter-spacing: -.035em; margin-bottom: .4em; }
.lp-lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 560px; margin-bottom: 24px; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.lp-ticks { list-style: none; padding: 0; margin: 0; font-size: .9rem; color: var(--ink-soft); }
.lp-ticks li { padding: 5px 0 5px 26px; position: relative; }
.lp-ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--sell); font-weight: 800; }

.lp-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.lp-card-head {
    background: var(--ink); color: #fff; padding: 14px 18px;
    font-weight: 700; font-size: .98rem; text-align: center;
}
.lp-card .price-old-rows { padding: 18px 18px 4px; }
.lp-card .price-free { margin: 16px 16px 0; }
/* Aire entre el bloque verde de la promoción y el botón, que también es
   verde: pegados se leían como una sola mancha de color. */
.lp-card-cta { padding: 14px 16px 16px; }
.lp-countdown { font-size: .78rem; color: var(--muted); text-align: center; margin: 10px 0 0; }

.lp-reason-ico {
    width: 52px; height: 52px; border-radius: 16px; background: var(--bg-soft);
    display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 14px;
}
.lp-list { list-style: none; padding: 0; margin: 0 0 16px; font-size: .93rem; }
.lp-list li { padding: 8px 0 8px 27px; position: relative; color: var(--ink-soft); line-height: 1.55; }
.lp-list li::before { content: "✓"; position: absolute; left: 0; top: 8px; color: var(--sell); font-weight: 800; }
.lp-fine .lp-list li::before { content: "•"; color: var(--muted); }

@media (max-width: 900px) {
    .lp-hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .lp-hero { padding-top: 32px; padding-bottom: 36px; margin-bottom: 34px; }
    .lp-h1 { font-size: 1.95rem; }
    .lp-lead { font-size: 1rem; }
    .lp-timeline { grid-template-columns: 1fr; gap: 12px; }
    .lp-step { padding: 18px; }
}

/* En móvil los dos botones no caben en una fila sin partirse en dos líneas:
   se apilan a ancho completo, que además da mejor zona de pulsación. */
@media (max-width: 560px) {
    .lp-cta { flex-direction: column; align-items: stretch; }
    .lp-cta .btn { width: 100%; }
    .lp-h1 { font-size: 1.75rem; }
}

/* --------------------------------------------------------------- Estado vacío */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ico { font-size: 2.8rem; margin-bottom: 14px; opacity: .5; }
.empty h3 { color: var(--ink); }

/* -------------------------------------------------- Franja «quiero vender» */
.sell-strip {
    background: var(--sell-light);
    border: 1px solid #c7ece0; border-radius: var(--radius-lg);
    padding: 26px 30px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    justify-content: space-between;
}
.sell-strip h2 { margin: 0 0 6px; font-size: 1.3rem; }
.sell-strip p { margin: 0; color: #2c5c4e; font-size: .95rem; max-width: 600px; }

/* Pasos numerados de «cómo funciona». */
.steps { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.step .n {
    width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: .92rem; margin-bottom: 12px;
}
.step h3 { font-size: 1rem; margin-bottom: 4px; }
.step p { font-size: .88rem; color: var(--muted); margin: 0; }

/* ------------------------------------------------------------------ Footer */
.site-footer { background: var(--bg-soft); color: var(--muted); margin-top: 72px; padding: 48px 0 26px; font-size: .9rem; border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 34px; grid-template-columns: 1.6fr repeat(3, 1fr); margin-bottom: 34px; }
.site-footer h4 { color: var(--ink); font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px; }
.site-footer a { color: var(--ink-soft); display: block; padding: 4px 0; }
.site-footer a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; }

/* -------------------------------------------------------------- Utilidades */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.flex-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; background: var(--bg-soft);
    border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font-size: .82rem;
}
.avatar {
    width: 42px; height: 42px; border-radius: 50%; background: var(--brand-light);
    color: var(--brand-dark); display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
    overflow: hidden;
}
.shop-banner {
    height: 130px; border-radius: var(--radius-lg); background: var(--bg-soft);
    overflow: hidden; margin-bottom: -50px;
}
.shop-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.shop-head { display: flex; gap: 20px; align-items: flex-end; position: relative; padding: 0; }
.shop-logo {
    width: 96px; height: 96px; border-radius: 22px; background: #fff; border: 3px solid #fff;
    box-shadow: var(--shadow-md); display: grid; place-items: center; font-size: 2rem; font-weight: 800;
    color: var(--brand); overflow: hidden; flex-shrink: 0;
}
.shop-logo img { width: 100%; height: 100%; object-fit: cover; }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 132px; margin-top: 14px; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.bar-chart .bar i { display: block; width: 100%; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 3px; }
.bar-chart .bar span { font-size: .68rem; color: var(--muted); }

.progress { height: 8px; background: var(--line); border-radius: 5px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); }

.stripe-note {
    background: var(--brand-soft); border: 1px solid #d8ddfb; border-radius: var(--radius);
    padding: 16px 18px; font-size: .9rem; color: #38359c;
}

/* ------------------------------------------------------------------ Móvil */
@media (max-width: 980px) {
    .panel-layout, .catalog-layout { grid-template-columns: 1fr; }
    .panel-nav, .filters { position: static; }
    .panel-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .panel-nav .nav-title, .panel-nav .nav-sep { display: none; }
    .product-detail { grid-template-columns: 1fr; gap: 28px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr; }

    /* Los filtros pasan a un desplegable nativo: <details class="filters"> */
    .filters-toggle {
        display: block; cursor: pointer; font-weight: 600; list-style: none;
        padding: 4px 0; color: var(--ink);
    }
    .filters-toggle::-webkit-details-marker { display: none; }
    .filters-toggle::after { content: " ▾"; color: var(--muted); }
    details.filters[open] .filters-toggle::after { content: " ▴"; }
    details.filters:not([open]) { padding-bottom: 14px; }
}

@media (max-width: 760px) {
    h1 { font-size: 1.55rem; }
    .hero { padding: 22px 0; margin-bottom: 26px; }
    .hero h1 { font-size: 1.35rem; }
    .header-main { flex-wrap: wrap; gap: 10px; padding: 11px 0; }
    .search-form { order: 3; flex-basis: 100%; max-width: none; }
    .search-form input { padding-right: 16px; }
    .search-form button { display: none; }
    .header-nav { margin-left: auto; gap: 4px; }
    .header-nav a span.label { display: none; }
    .header-nav .btn-sell { padding: 9px 15px; font-size: .88rem; }
    .header-nav .btn-sell span.label { display: inline !important; }
    .form-row, .form-row-3, .grid-2 { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 12px; }
    .cat-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
    .cat-tile { padding: 16px 8px 14px; border-radius: var(--radius); }
    .cat-tile .ico { width: 62px; height: 62px; font-size: 2.1rem; margin-bottom: 9px; }
    .cat-tile .name { font-size: .85rem; }
    .cat-tile .count { display: none; }
    .card { padding: 18px; }
    .table-wrap { margin: 0 -18px; padding: 0 18px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .cart-item { flex-wrap: wrap; }
    .sell-strip { padding: 22px; }
    .price-big { font-size: 1.9rem; }
}

@media print {
    .site-header, .site-footer, .panel-nav, .btn, form { display: none !important; }
    body { background: #fff; }
}

/* ------------------------------------------------- Modo de venta (🤝 / 🚚)
   El distintivo ocupa siempre la MISMA posición en la tarjeta y en la ficha,
   para que la diferencia entre venta en mano y vendedor registrado se lea de
   un vistazo sin tener que buscarla. */
.mode-flag {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1rem; line-height: 1;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 6px rgba(15, 20, 32, .18);
    cursor: help;
}

/* Misma pareja de iconos, en línea, para la ficha y los listados de texto. */
.mode-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 13px 6px 10px; border-radius: 999px;
    font-size: .82rem; font-weight: 600; white-space: nowrap;
}
.mode-tag .ico { font-size: 1rem; line-height: 1; }
.mode-tag.mode-offline { background: var(--ok-bg);   color: #056042; }
.mode-tag.mode-online  { background: var(--info-bg); color: #1e40af; }

.mode-legend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Aviso de correo sin confirmar: visible pero sin tapar la navegación. */
.verify-bar {
    background: var(--warn-bg); color: #8a4f06;
    border-bottom: 1px solid #fbe3b6; font-size: .88rem;
}
.verify-bar .wrap { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 10px 22px; }
.verify-bar a { color: #8a4f06; font-weight: 600; text-decoration: underline; }
