/*
 * assets/css/tienda.css — Sistema de diseño tienda pública HRM Estudio
 * Importar después de bootstrap.min.css e icons.css
 */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --t-primary:      #1a2035;
    --t-primary-h:    #2d3a5e;
    --t-bg:           #f4f6fb;
    --t-dark:         #1a2035;
    --t-muted:        #6c757d;
    --t-border:       #e3e7ef;
    --t-card-radius:  10px;
    --t-btn-radius:   8px;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
    background:  var(--t-bg);
    font-family: 'Segoe UI', sans-serif;
    font-size:   14px;
    color:       #333;
}

/* ── Navbar (checkout / pago / confirmacion) ───────────────────────────────── */
.tienda-nav {
    background:      var(--t-primary);
    padding:         14px 24px;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    position:        relative;
    z-index:         999;
}
.tienda-nav img { height: 32px; }
.tienda-nav .nav-links { display: flex; gap: 20px; align-items: center; }
.tienda-nav .nav-link-t {
    color:           rgba(255,255,255,.75);
    text-decoration: none;
    font-size:       .85rem;
    transition:      color .15s;
}
.tienda-nav .nav-link-t:hover { color: #fff; }

/* ── Top band (catálogo / renovar) — estilo encabezado de correo ───────────── */
.tienda-topband {
    background:      var(--t-primary);
    padding:         20px 32px;         /* altura total ≈ 55px logo + 40px padding ≈ 95px */
    display:         flex;
    align-items:     center;
    justify-content: center;
    line-height:     0;
}
.tienda-topband a { line-height: 0; display: block; }
.tienda-topband img {
    display:     block;
    height:      55px;                  /* mismo tamaño que en correos */
    width:       auto;
    max-width:   220px;
}

/* ── Sub-nav (links bajo el topband) ──────────────────────────────────────── */
.tienda-subnav {
    background:      #fff;
    border-bottom:   1px solid var(--t-border);
    display:         flex;
    justify-content: center;
    gap:             28px;
    padding:         8px 24px;
}
.tienda-subnav a {
    color:           var(--t-muted);
    text-decoration: none;
    font-size:       .8rem;
    transition:      color .15s;
}
.tienda-subnav a:hover { color: var(--t-primary); }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.t-hero {
    background:  linear-gradient(135deg, var(--t-primary) 0%, var(--t-primary-h) 100%);
    color:       #fff;
    padding:     52px 24px 44px;
    text-align:  center;
}
.t-hero h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 8px; }
.t-hero p  { color: rgba(255,255,255,.75); margin-bottom: 0; font-size: .95rem; }

/* ── Botón principal ───────────────────────────────────────────────────────── */
.btn-hrm {
    background:      var(--t-primary);
    color:           #fff;
    border:          none;
    border-radius:   var(--t-btn-radius);
    padding:         10px 24px;
    font-weight:     600;
    font-size:       .875rem;
    cursor:          pointer;
    text-decoration: none;
    display:         inline-block;
    transition:      background .15s;
    line-height:     1.4;
}
.btn-hrm:hover  { background: var(--t-primary-h); color: #fff; }
.btn-hrm.w-100  { display: block; text-align: center; padding: 13px 24px; font-size: .95rem; }
.btn-hrm-sm     { padding: 6px 14px; font-size: .8rem; border-radius: 6px; }

/* Botón secundario */
.btn-hrm-dark {
    background:    #495057;
    color:         #fff;
    border:        none;
    border-radius: var(--t-btn-radius);
    padding:       8px 18px;
    font-weight:   600;
    font-size:     .85rem;
    cursor:        pointer;
    text-decoration: none;
    display:       inline-block;
    transition:    background .15s;
}
.btn-hrm-dark:hover { background: #343a40; color: #fff; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.t-card {
    background:    #fff;
    border-radius: var(--t-card-radius);
    border:        1px solid var(--t-border);
    padding:       24px;
    margin-bottom: 16px;
}
.t-card-label {
    font-size:      .72rem;
    font-weight:    700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color:          var(--t-muted);
    margin-bottom:  14px;
    display:        block;
}

/* ── Producto card (catálogo) ──────────────────────────────────────────────── */
.prod-card {
    background:     #fff;
    border-radius:  var(--t-card-radius);
    border:         1px solid var(--t-border);
    padding:        22px 20px 18px;
    height:         100%;
    display:        flex;
    flex-direction: column;
    transition:     box-shadow .15s, transform .15s;
}
.prod-card:hover {
    box-shadow: 0 6px 24px rgba(26,32,53,.10);
    transform:  translateY(-2px);
}
/* ── Logo del producto ─────────────────────────────────────────────────────── */
.prod-logo-wrap {
    height:          64px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    margin-bottom:   10px;
}
.prod-logo {
    max-height: 54px;
    max-width:  160px;
    width:      auto;
    object-fit: contain;
}

.prod-nombre      { font-weight: 700; color: var(--t-dark); font-size: .97rem; margin: 8px 0 4px; line-height: 1.3; }
.prod-vigencia    { color: var(--t-muted); font-size: .78rem; margin-bottom: 14px; }
.prod-precio-usd  { font-size: 1.45rem; font-weight: 700; color: var(--t-dark); line-height: 1; }
.prod-precio-usd small { font-size: .78rem; font-weight: 400; color: var(--t-muted); }
.prod-precio-original { text-decoration: line-through; color: #bbb; font-size: .82rem; }
.prod-precio-cop  { font-size: .79rem; color: var(--t-muted); margin-top: 3px; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.t-badge {
    font-size:      .68rem;
    font-weight:    700;
    border-radius:  4px;
    padding:        2px 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.t-badge-trimble { background: #dbeafe; color: #1d4ed8; }
.t-badge-chaos   { background: #fff0e6; color: #b33d00; }
.t-badge-otro    { background: #f0f0f0; color: #555; }
.t-badge-acad    { background: #e9fbe9; color: #166534; }
.t-badge-promo   { background: #d4edda; color: #155724; }
.t-badge-renov   { background: #fff3cd; color: #856404; }
.t-badge-cupon   { background: #fff3cd; color: #856404; }

/* ── Filtros catálogo ──────────────────────────────────────────────────────── */
.t-filtros {
    background:    #fff;
    border-bottom: 1px solid var(--t-border);
    padding:       12px 0;
    position:      sticky;
    top:           87px;   /* altura del header band (55px logo + 32px padding) */
    z-index:       100;
}
.btn-filtro {
    border:        1px solid var(--t-border);
    background:    #fff;
    color:         #555;
    border-radius: 20px;
    padding:       5px 15px;
    font-size:     .8rem;
    cursor:        pointer;
    transition:    all .15s;
}
.btn-filtro:hover, .btn-filtro.activo {
    background:   var(--t-primary);
    color:        #fff;
    border-color: var(--t-primary);
}

/* ── Formulario ────────────────────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
    border-color: var(--t-primary);
    box-shadow:   0 0 0 0.2rem rgba(26,32,53,.15);
}
.form-check-input:checked {
    background-color: var(--t-primary);
    border-color:     var(--t-primary);
}
.form-label { font-size: .83rem; font-weight: 500; }

/* ── Botones de selección ──────────────────────────────────────────────────── */
.sel-btn {
    cursor:     pointer;
    border:     2px solid var(--t-border);
    border-radius: 8px;
    padding:    12px 14px;
    transition: border-color .15s, background .15s;
    background: #fff;
}
.sel-btn:hover, .sel-btn.active {
    border-color: var(--t-primary);
    background:   #f0f2f8;
}
.sel-btn input { display: none; }

/* ── Método de pago ─────────────────────────────────────────────────────────── */
.metodo-card {
    cursor:        pointer;
    border:        2px solid var(--t-border);
    border-radius: 8px;
    padding:       14px 16px;
    display:       flex;
    align-items:   center;
    gap:           12px;
    transition:    border-color .15s, background .15s;
    background:    #fff;
}
.metodo-card:hover, .metodo-card.active {
    border-color: var(--t-primary);
    background:   #f0f2f8;
}
.metodo-card input { display: none; }
.metodo-icon { font-size: 1.6rem; color: var(--t-primary); min-width: 32px; }

/* ── Resumen de pedido ──────────────────────────────────────────────────────── */
.resumen-box {
    background:    #fff;
    border-radius: var(--t-card-radius);
    border:        1px solid var(--t-border);
    padding:       20px;
    position:      sticky;
    top:           20px;
}
.resumen-precio-main { font-size: 1.4rem; font-weight: 700; color: var(--t-dark); }
.resumen-precio-cop  { font-size: .82rem; color: var(--t-muted); }

/* ── Cupón ─────────────────────────────────────────────────────────────────── */
.cupon-toggle {
    font-size:       .8rem;
    color:           var(--t-muted);
    cursor:          pointer;
    text-decoration: underline dotted;
    background:      none;
    border:          none;
    padding:         0;
}
.cupon-toggle:hover { color: var(--t-primary); }
.cupon-row { display: flex; gap: 8px; margin-top: 8px; }
.cupon-row input { font-family: monospace; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; }
.btn-cupon {
    background:    var(--t-primary);
    color:         #fff;
    border:        none;
    border-radius: 6px;
    padding:       6px 14px;
    font-size:     .8rem;
    font-weight:   600;
    cursor:        pointer;
    white-space:   nowrap;
}
.btn-cupon:hover { background: var(--t-primary-h); }
.cupon-ok  { color: #198754; font-size: .82rem; font-weight: 600; }
.cupon-err { color: #dc3545; font-size: .8rem; }

/* ── Banner renovación ──────────────────────────────────────────────────────── */
.renovar-banner {
    background:    var(--t-primary);
    color:         #fff;
    border-radius: var(--t-card-radius);
    padding:       22px 28px;
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    flex-wrap:     wrap;
    gap:           14px;
    margin:        10px 0 28px;
}
.renovar-banner p { margin: 0; opacity: .8; font-size: .88rem; }
.btn-renovar-inv {
    background:      #fff;
    color:           var(--t-primary);
    border:          none;
    padding:         9px 22px;
    border-radius:   var(--t-btn-radius);
    font-weight:     700;
    font-size:       .875rem;
    text-decoration: none;
    white-space:     nowrap;
    display:         inline-block;
}
.btn-renovar-inv:hover { background: #e8eaf2; color: var(--t-primary); }

/* ── Confirmación ───────────────────────────────────────────────────────────── */
.conf-box {
    background:    #fff;
    border-radius: var(--t-card-radius);
    border:        1px solid var(--t-border);
    padding:       40px;
    max-width:     560px;
    margin:        48px auto;
    text-align:    center;
}
.conf-icon   { font-size: 3.5rem; }
.conf-titulo { font-size: 1.4rem; font-weight: 700; color: var(--t-dark); margin-top: 12px; }
.conf-sub    { color: var(--t-muted); margin-top: 6px; }
.detalle-row {
    display:         flex;
    justify-content: space-between;
    padding:         8px 0;
    border-bottom:   1px solid #f0f2f8;
    font-size:       .88rem;
}
.detalle-row:last-child { border-bottom: none; }
.btn-portal {
    background:      var(--t-primary);
    color:           #fff;
    border:          none;
    padding:         12px 28px;
    border-radius:   var(--t-btn-radius);
    font-weight:     600;
    text-decoration: none;
    display:         inline-block;
    margin-top:      8px;
    transition:      background .15s;
}
.btn-portal:hover { background: var(--t-primary-h); color: #fff; }

/* ── Trust icons ────────────────────────────────────────────────────────────── */
.trust-grid {
    display:         flex;
    justify-content: center;
    gap:             32px;
    flex-wrap:       wrap;
    padding:         20px 0;
    color:           var(--t-muted);
    font-size:       .78rem;
}
.trust-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.trust-item i { font-size: 1.5rem; }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.t-footer {
    background:   var(--t-primary);
    color:        rgba(255,255,255,.6);
    padding:      20px 24px;
    text-align:   center;
    font-size:    .78rem;
    margin-top:   auto;
}
.t-footer a { color: rgba(255,255,255,.6); }
.t-footer a:hover { color: #fff; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .t-hero h1 { font-size: 1.35rem; }
    .prod-precio-usd { font-size: 1.2rem; }
    .tienda-nav .nav-links { gap: 12px; }
}
@media (max-width: 991px) {
    .resumen-box { position: static; }
}
