/* =============================================================================
   TechZhop · Sistema visual estilo marketplace (Amazon-like)
   -----------------------------------------------------------------------------
   Organización:
     0. Tokens de diseño            5. Tarjeta de producto
     1. Base y utilidades           6. Detalle de producto / reseñas
     2. Botones                     7. Carrito / checkout
     3. Cabecera (2 barras)         8. Auth / filtros / tienda
     4. Home (hero + categorías)    9. Pie de página + responsive
   Patrón de color y layout inspirado en marketplaces tipo Amazon; marca propia.
   ========================================================================== */

/* -------- 0. Tokens -------- */
:root{
    /* Superficies y estructura */
    --navy:#131921;        /* barra superior */
    --navy-2:#232f3e;      /* subnav y columnas del pie */
    --navy-3:#37475a;      /* hover / volver arriba */
    --bottom:#0f1720;      /* franja inferior del pie */
    --bg:#eaeded;          /* fondo de página */
    --surface:#ffffff;
    --ink:#0f1111;         /* texto principal */
    --muted:#565959;       /* texto secundario */
    --muted-2:#6f7373;

    /* Marca / acentos */
    --link:#007185;        /* enlaces */
    --link-hover:#c7511f;  /* hover de enlaces */
    --yellow:#ffd814;      /* añadir al carrito */
    --yellow-h:#f7ca00;
    --yellow-bd:#fcd200;
    --orange:#ffa41c;      /* comprar ya / acentos */
    --orange-h:#fa8900;
    --search:#febd69;      /* botón de búsqueda */
    --search-h:#f3a847;
    --star:#ffa41c;
    --deal:#cc0c39;        /* precio/ahorro */
    --ok:#007600;
    --danger:#b12704;

    /* Líneas y sombras */
    --border:#d5d9d9;
    --line:#e7e7e7;
    --shadow:0 2px 5px rgba(15,17,17,.15);
    --shadow-hover:0 6px 16px rgba(15,17,17,.18);
    --radius:8px;
    --maxw:1500px;
    --font:"Amazon Ember",Arial,"Helvetica Neue",Helvetica,system-ui,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--font);background:var(--bg);color:var(--ink);
    line-height:1.4;font-size:14px;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
h1,h2,h3,h4{line-height:1.25}
.container{max-width:var(--maxw);margin:0 auto;padding:0 18px}
.muted{color:var(--muted)}
:focus-visible{outline:2px solid #e77600;outline-offset:1px;border-radius:2px}

/* -------- 1. Utilidades -------- */
.page{padding:18px 18px 40px;min-height:60vh}
.block{margin:22px 0}
.block-title{font-size:21px;font-weight:700;margin:0 0 14px;color:var(--ink)}
.breadcrumb{font-size:13px;color:var(--muted);margin-bottom:14px}
.breadcrumb a{color:var(--link)}
.breadcrumb a:hover{color:var(--link-hover);text-decoration:underline}

/* Estrellas reutilizables */
.a-stars{position:relative;display:inline-block;font-size:15px;line-height:1;
    letter-spacing:1px;vertical-align:middle;white-space:nowrap}
.a-stars-empty{color:#e0e0e0}
.a-stars-fill{position:absolute;left:0;top:0;overflow:hidden;color:var(--star);white-space:nowrap}
.a-stars-count{margin-left:6px;color:var(--link);font-size:13px;vertical-align:middle}
.a-stars-count:hover{color:var(--link-hover);text-decoration:underline}

/* Precio estilo marketplace */
.a-price{color:var(--ink);white-space:nowrap}
.a-price-sym{font-size:.72em;position:relative;top:-.5em;margin-right:2px}
.a-price-whole{font-size:1.55em;font-weight:600;letter-spacing:-.3px}
del .a-price,.a-price--old{color:var(--muted);font-weight:400}
del .a-price-whole{font-size:1em;font-weight:400}

/* -------- 2. Botones -------- */
.btn{display:inline-block;border:1px solid var(--border);background:#fff;color:var(--ink);
    padding:9px 16px;border-radius:var(--radius);cursor:pointer;font-size:14px;font-weight:500;
    transition:background .12s,border-color .12s,box-shadow .12s;line-height:1.2;text-align:center}
.btn:hover{background:#f7fafa}
.btn:active{box-shadow:inset 0 2px 4px rgba(15,17,17,.15)}
.btn-primary{background:var(--yellow);border-color:var(--yellow-bd);color:#0f1111}
.btn-primary:hover{background:var(--yellow-h)}
.btn-orange{background:var(--orange);border-color:#e8981a;color:#0f1111}
.btn-orange:hover{background:var(--orange-h)}
.btn-block{display:block;width:100%}
/* Añadir al carrito (píldora amarilla característica) */
.btn-add{width:100%;margin-top:10px;background:var(--yellow);
    border:1px solid var(--yellow-bd);color:#0f1111;border-radius:20px;font-weight:500;padding:8px 14px}
.btn-add:hover{background:var(--yellow-h)}
.btn-add:disabled{opacity:.7;cursor:default}
.btn-gradient{background:var(--yellow);border-color:var(--yellow-bd);color:#0f1111}

/* -------- 3. Cabecera -------- */
.site-header{position:sticky;top:0;z-index:200}
.brandstrip{display:none}
.header-top{display:flex;align-items:center;gap:8px;background:var(--navy);
    color:#fff;padding:6px 14px;max-width:none}
/* Elemento de navegación con borde al pasar/enfocar (patrón del marketplace) */
.brand,.deliver-to,.ha-link,.ha-cart,.acct{border:1px solid transparent;border-radius:2px;
    padding:6px 8px;transition:border-color .1s}
.brand:hover,.deliver-to:hover,.ha-link:hover,.ha-cart:hover,.acct:hover{border-color:#fff}
.brand{display:flex;align-items:center;gap:8px;white-space:nowrap}
.brand-logo{width:34px;height:34px;border-radius:6px;flex:none}
.brand-word{font-size:21px;font-weight:800;letter-spacing:.3px;color:#fff;line-height:1}
.brand-word span{color:var(--orange)}
.deliver-to{display:flex;align-items:center;gap:6px;color:#fff}
.deliver-to svg{fill:#fff;flex:none}
.deliver-to .dt-text{display:flex;flex-direction:column;line-height:1.15}
.deliver-to .dt-text small{font-size:12px;color:#ccced0}
.deliver-to .dt-text strong{font-size:14px}

/* Buscador */
.searchbar{flex:1;display:flex;position:relative;min-width:180px;height:40px;border-radius:6px;
    overflow:visible;box-shadow:0 1px 2px rgba(0,0,0,.15)}
.searchbar:focus-within{outline:3px solid var(--orange);border-radius:6px}
.search-scope{display:flex;align-items:center;background:#f3f3f3;color:#555;border:none;
    border-radius:6px 0 0 6px;padding:0 10px;font-size:12px;max-width:120px;cursor:pointer;
    border-right:1px solid #cdcdcd}
.searchbar input{flex:1;border:none;padding:0 14px;font-size:15px;outline:none;background:#fff;min-width:0}
.searchbar button{border:none;background:var(--search);color:#0f1111;border-radius:0 6px 6px 0;
    width:45px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.searchbar button:hover{background:var(--search-h)}
.suggestions{position:absolute;top:calc(100% + 2px);left:0;right:0;background:#fff;
    border:1px solid var(--border);border-radius:0 0 6px 6px;box-shadow:var(--shadow);
    overflow:hidden;display:none;z-index:60}
.suggestions a{display:block;padding:10px 14px;border-bottom:1px solid var(--line);color:var(--ink);font-size:14px}
.suggestions a:last-child{border-bottom:none}
.suggestions a:hover{background:#f3f3f3}

/* Acciones derecha */
.header-actions{display:flex;align-items:center;gap:2px;white-space:nowrap}
.ha-link,.acct{display:flex;flex-direction:column;font-size:12px;color:#fff;line-height:1.3}
.ha-link strong,.acct strong{font-size:14px;font-weight:700}
.ha-cart{position:relative;display:flex;align-items:flex-end;gap:4px;color:#fff}
.ha-cart svg{fill:#fff}
.ha-cart .ha-cart-word{font-size:14px;font-weight:700}
.cart-count{position:absolute;top:-4px;left:20px;color:var(--orange);font-size:16px;font-weight:700;
    min-width:18px;text-align:center;line-height:1}

/* Subnav */
.catbar{background:var(--navy-2)}
.catbar .container{display:flex;align-items:center;gap:2px;overflow-x:auto;max-width:var(--maxw);
    scrollbar-width:none}
.catbar .container::-webkit-scrollbar{display:none}
.catbar a{color:#fff;padding:8px 9px;font-size:14px;white-space:nowrap;font-weight:500;
    border:1px solid transparent;border-radius:2px}
.catbar a:hover{border-color:#fff}
.catbar .cb-all{font-weight:700;display:flex;align-items:center;gap:6px}

/* -------- 4. Home -------- */
.hero{position:relative;border-radius:6px;overflow:hidden;margin-top:6px;
    background:var(--navy-2);
    color:#fff;min-height:230px;display:flex;align-items:flex-start}
.hero-text{position:relative;z-index:1;padding:36px 40px 92px;max-width:640px}
.hero-text h1{margin:0 0 10px;font-size:32px;font-weight:800;letter-spacing:-.5px}
.hero-text p{margin:0 0 18px;font-size:16px;opacity:.92}
.hero .btn-primary{padding:11px 22px;border-radius:20px;font-weight:700}

/* Tarjetas superpuestas al hero (patrón de cajas del marketplace) */
.home-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:18px;
    margin-top:-40px;position:relative;z-index:2}
.cat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px}
.cat-card{background:var(--surface);border-radius:4px;padding:16px;box-shadow:var(--shadow);
    display:flex;flex-direction:column;min-height:150px;transition:box-shadow .15s}
.cat-card:hover{box-shadow:var(--shadow-hover)}
.cat-card .cc-title{font-size:18px;font-weight:700;margin-bottom:10px;color:var(--ink)}
.cat-card .cc-thumb{flex:1;border-radius:4px;background:#eef1f3;
    display:grid;place-items:center;color:#8794a5;
    font-size:34px;font-weight:800}
.cat-card .cc-link{margin-top:10px;color:var(--link);font-size:13px;font-weight:600}
.cat-card:hover .cc-link{color:var(--link-hover);text-decoration:underline}

/* -------- 5. Tarjeta de producto -------- */
.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}
.product-card{background:var(--surface);border:1px solid transparent;border-radius:6px;
    overflow:hidden;display:flex;flex-direction:column;transition:box-shadow .15s,border-color .15s}
.product-card:hover{box-shadow:var(--shadow-hover);border-color:#e3e6e6}
.pc-img{position:relative;aspect-ratio:1;background:#fff;padding:14px}
.pc-img img{width:100%;height:100%;object-fit:contain}
.badge{position:absolute;top:10px;left:10px;background:var(--deal);color:#fff;
    font-size:12px;font-weight:700;padding:3px 8px;border-radius:4px}
.pc-body{padding:0 14px 14px;display:flex;flex-direction:column;flex:1}
.pc-name{font-size:15px;font-weight:400;color:var(--ink);display:-webkit-box;-webkit-line-clamp:2;
    -webkit-box-orient:vertical;overflow:hidden;min-height:42px;line-height:1.4}
.pc-name:hover{color:var(--link-hover);text-decoration:underline}
.pc-rating{display:flex;align-items:center;gap:2px;margin:5px 0 2px}
.pc-vendor{font-size:12px;color:var(--muted);margin:2px 0}
.pc-price{margin:6px 0 2px}
.pc-price del{margin-left:8px;font-size:13px}
.pc-save{font-size:12px;color:var(--deal);font-weight:600;margin-left:8px}

/* -------- 6. Detalle de producto (layout tipo "buy box") -------- */
.product-detail{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) 300px;gap:30px;
    background:var(--surface);border-radius:8px;padding:26px;box-shadow:var(--shadow);align-items:start}
.pd-gallery #pdMain{width:100%;aspect-ratio:1;object-fit:contain;background:#fff;border-radius:8px;
    border:1px solid var(--line)}
.pd-thumbs{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.pd-thumbs img{width:60px;height:60px;object-fit:cover;border:1px solid var(--border);
    border-radius:6px;cursor:pointer}
.pd-thumbs img:hover{border-color:var(--orange);box-shadow:0 0 0 2px rgba(255,164,28,.4)}
.pd-info h1{margin:0 0 6px;font-size:26px;font-weight:500;line-height:1.25}
.pd-vendor{font-size:14px;color:var(--muted)}
.pd-vendor a{color:var(--link)}.pd-vendor a:hover{color:var(--link-hover);text-decoration:underline}
.pd-rating{display:flex;align-items:center;gap:6px;margin:6px 0;color:var(--link);font-size:14px}
.pd-price{margin:14px 0;padding:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.pd-price .a-price-whole{font-size:34px}
.pd-price del{margin-left:12px}
.pd-stock{font-size:18px;margin:10px 0;font-weight:500}
.pd-stock.in{color:var(--ok)}.pd-stock.out{color:var(--danger)}
.pd-actions{display:flex;gap:12px;margin:18px 0;align-items:center}
.pd-actions input{width:72px;padding:10px;border:1px solid var(--border);border-radius:8px;font-size:15px}
.pd-actions .btn{padding:11px 26px;border-radius:20px;font-weight:700}
.pd-desc{margin-top:22px;border-top:1px solid var(--line);padding-top:18px}
.pd-desc h3{font-size:18px;margin:0 0 8px}

/* Reseñas */
.review{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:16px;margin-bottom:12px}
.review-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.stars{color:var(--star);letter-spacing:1px}

/* Columna central + caja de compra (buy box) */
.pd-center .pd-price{border:none;padding:0;margin:10px 0}
.buybox{border:1px solid var(--border);border-radius:8px;padding:16px 18px;position:sticky;top:110px;background:#fff}
.buybox .bb-price .a-price-whole{font-size:28px}
.buybox .pd-stock{font-size:18px;margin:8px 0 4px}
.buybox .bb-ship{font-size:13px;color:var(--muted);margin:6px 0 14px}
.buybox .bb-ship b{color:var(--ink)}
.buybox .bb-qty{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.buybox .bb-qty label{font-size:13px;color:var(--muted)}
.buybox .bb-qty input{width:64px;padding:8px;border:1px solid var(--border);border-radius:8px}
.buybox .btn{width:100%;border-radius:20px;font-weight:600;margin-bottom:10px;padding:10px}
.buybox .bb-secure{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;margin-top:6px}
.buybox .bb-secure svg{fill:var(--ok);flex:none}
.buybox .bb-vendor{font-size:13px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.buybox .bb-vendor a{color:var(--link)}.buybox .bb-vendor a:hover{color:var(--link-hover);text-decoration:underline}

/* -------- 7. Carrito / checkout -------- */
.cart-layout{display:grid;grid-template-columns:1fr 320px;gap:22px;align-items:start}
.cart-list,.cart-panel{background:var(--surface);border-radius:8px;padding:6px 20px;box-shadow:var(--shadow)}
.cart-list .block-title{padding:14px 0 0}
.cart-row{display:grid;grid-template-columns:96px 1fr 90px 120px 30px;gap:14px;align-items:center;
    padding:16px 0;border-bottom:1px solid var(--line)}
.cart-row:last-child{border-bottom:none}
.cart-row img{width:96px;height:96px;object-fit:contain;background:#fff;border-radius:6px}
.cart-row-info a{font-weight:500;color:var(--ink)}
.cart-row-info a:hover{color:var(--link-hover);text-decoration:underline}
.unit-price{display:block;font-size:13px;color:var(--ok);margin-top:4px}
.cart-qty{width:70px;padding:8px;border:1px solid var(--border);border-radius:8px}
.row-subtotal{font-weight:700;text-align:right}
.cart-remove{background:none;border:none;font-size:22px;color:var(--muted);cursor:pointer;line-height:1}
.cart-remove:hover{color:var(--danger)}
.cart-summary{background:var(--surface);border-radius:8px;padding:20px;box-shadow:var(--shadow);
    position:sticky;top:110px}
.cs-row{display:flex;justify-content:space-between;padding:6px 0;font-size:14px}
.cs-total{border-top:1px solid var(--line);margin-top:8px;padding-top:12px;font-size:18px;font-weight:700;color:var(--danger)}
.cart-summary .btn-primary{width:100%;padding:11px;border-radius:20px;font-weight:700;margin-top:12px}

/* -------- 8. Auth / filtros / tienda -------- */
.auth-box{max-width:400px;margin:24px auto;background:var(--surface);border:1px solid var(--border);
    border-radius:8px;padding:26px}
.auth-box h1{margin:0 0 18px;font-size:26px;font-weight:500}
.auth-box label{display:block;margin-bottom:14px;font-size:13px;font-weight:700}
.auth-box input,.auth-box select{width:100%;margin-top:6px;padding:9px;border:1px solid #a6a6a6;
    border-radius:4px;font-size:15px;font-weight:400;box-shadow:inset 0 1px 2px rgba(15,17,17,.1)}
.auth-box input:focus,.auth-box select:focus{outline:none;border-color:#e77600;
    box-shadow:0 0 0 3px rgba(228,121,17,.35)}
.auth-box .btn-primary{width:100%;margin-top:4px;border-radius:8px;font-weight:500}
.auth-alt{margin-top:18px;font-size:13px;text-align:center;color:var(--muted)}
.auth-alt a{color:var(--link);font-weight:600}.auth-alt a:hover{color:var(--link-hover);text-decoration:underline}
.alert{padding:10px 14px;border-radius:6px;margin-bottom:14px;font-size:14px}
.alert-error{background:#fff0ef;color:var(--danger);border:1px solid #f0c2bd}

.filters{display:flex;gap:14px;flex-wrap:wrap;align-items:end;background:var(--surface);
    border:1px solid var(--border);border-radius:8px;padding:14px;margin-bottom:20px}
.filters label{font-size:13px;font-weight:600;display:flex;flex-direction:column;gap:4px}
.filters input,.filters select{padding:8px;border:1px solid var(--border);border-radius:6px}

.store-header{background:var(--navy-2);color:#fff;border-radius:8px;
    padding:26px;margin-bottom:20px}
.store-header h1{margin:0 0 6px}
.store-header a{color:var(--orange)}

/* -------- 9. Pie de página -------- */
.site-footer{margin-top:44px}
.foot-top{background:var(--navy-3);color:#fff}
.foot-top a{display:block;text-align:center;padding:15px;font-size:13px}
.foot-top a:hover{background:#485769}
.footer-grid{background:var(--navy-2);color:#ddd;display:grid;
    grid-template-columns:repeat(4,1fr);gap:24px;padding:40px 18px;max-width:var(--maxw);margin:0 auto}
.footer-grid h4{color:#fff;margin:0 0 12px;font-size:16px}
.footer-grid a{display:block;padding:4px 0;color:#ddd;font-size:13px}
.footer-grid a:hover{text-decoration:underline}
.footer-mid{background:var(--navy-2);border-top:1px solid #3a4553;padding:22px 0;text-align:center}
.footer-mid .brand-word{font-size:22px}
.footer-bottom{background:var(--bottom);color:#ddd;padding:22px 0;font-size:12px;text-align:center}

/* -------- Responsive -------- */
@media(max-width:1000px){
    .product-detail{grid-template-columns:1fr 1fr}
    .buybox{grid-column:1 / -1;position:static;max-width:360px}
    .cart-layout{grid-template-columns:1fr}
    .footer-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
    .product-detail{grid-template-columns:1fr}
}
@media(max-width:760px){
    .header-top{flex-wrap:wrap}
    .searchbar{order:5;flex-basis:100%;max-width:none}
    .deliver-to{display:none}
    .home-cards{margin-top:16px}
    .footer-grid{grid-template-columns:1fr 1fr}
    .hero-text h1{font-size:24px}
}
@media(max-width:560px){
    .brand-word{display:none}
    .ha-link span,.acct span{display:none}
    .footer-grid{grid-template-columns:1fr}
    .cart-row{grid-template-columns:64px 1fr 30px;grid-template-areas:"img info remove" "img qty sub";row-gap:8px}
    .cart-row img{grid-area:img;width:64px;height:64px}.cart-row-info{grid-area:info}
    .cart-qty{grid-area:qty}.row-subtotal{grid-area:sub;text-align:left}.cart-remove{grid-area:remove}
}
