/* ===========================================================
   HRTools - Paleta tomada del logo
   =========================================================== */
:root {
    --hr-navy: #0a1f5c;        /* azul marino del logo */
    --hr-navy-dark: #061645;
    --hr-blue: #1a3aa8;        /* azul intermedio */
    --hr-cyan: #4dc4ff;        /* azul claro / cyan brillo del logo */
    --hr-cyan-soft: #a8e0ff;
    --hr-bg: #f5f8fc;
    --hr-surface: #ffffff;
    --hr-text: #0b1330;
    --hr-muted: #5c6a85;
    --hr-border: #d9e2ef;
    --hr-success: #16a34a;
    --hr-danger: #dc2626;
    --hr-warning: #d97706;
    --hr-shadow: 0 4px 18px rgba(10, 31, 92, 0.08);
    --hr-shadow-hover: 0 8px 24px rgba(10, 31, 92, 0.16);
    --hr-radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--hr-text);
    background: var(--hr-bg);
    min-height: 100vh;
}

a { color: var(--hr-blue); text-decoration: none; }
a:hover { color: var(--hr-cyan); }

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header / Navbar ---------- */
.navbar {
    background: linear-gradient(135deg, var(--hr-navy) 0%, var(--hr-navy-dark) 100%);
    color: #fff;
    box-shadow: var(--hr-shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.5px;
}

.brand img {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.nav-search {
    flex: 1;
    max-width: 480px;
    display: flex;
}

.nav-search input {
    flex: 1;
    border: none;
    border-radius: var(--hr-radius) 0 0 var(--hr-radius);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
}

.nav-search button {
    background: var(--hr-cyan);
    color: var(--hr-navy);
    border: none;
    padding: 0 18px;
    font-weight: 700;
    border-radius: 0 var(--hr-radius) var(--hr-radius) 0;
    cursor: pointer;
    transition: background 0.2s;
}
.nav-search button:hover { background: var(--hr-cyan-soft); }

.nav-links {
    display: flex;
    gap: 18px;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: #fff;
    font-weight: 500;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}
.nav-links a:hover { border-bottom-color: var(--hr-cyan); color: var(--hr-cyan); }

.cart-link { position: relative; }
.cart-badge {
    background: var(--hr-cyan);
    color: var(--hr-navy);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    margin-left: 4px;
    vertical-align: top;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--hr-radius);
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.05s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--hr-navy);
    color: #fff;
}
.btn-primary:hover { background: var(--hr-blue); color: #fff; box-shadow: var(--hr-shadow-hover); }

.btn-accent {
    background: var(--hr-cyan);
    color: var(--hr-navy);
}
.btn-accent:hover { background: var(--hr-cyan-soft); color: var(--hr-navy); }

.btn-outline {
    background: transparent;
    color: var(--hr-navy);
    border: 2px solid var(--hr-navy);
}
.btn-outline:hover { background: var(--hr-navy); color: #fff; }

.btn-danger { background: var(--hr-danger); color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ---------- Flash messages ---------- */
.flashes {
    max-width: 1200px;
    margin: 16px auto 0;
    padding: 0 20px;
}
.flash {
    padding: 12px 16px;
    border-radius: var(--hr-radius);
    margin-bottom: 10px;
    border-left: 4px solid;
    background: #fff;
    box-shadow: var(--hr-shadow);
}
.flash-success { border-color: var(--hr-success); color: #14532d; }
.flash-danger  { border-color: var(--hr-danger);  color: #7f1d1d; }
.flash-warning { border-color: var(--hr-warning); color: #78350f; }
.flash-info    { border-color: var(--hr-cyan);    color: var(--hr-navy); }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(120deg, var(--hr-navy) 0%, var(--hr-blue) 60%, var(--hr-cyan) 130%);
    color: #fff;
    padding: 60px 20px;
    text-align: center;
    border-radius: 0 0 24px 24px;
    box-shadow: var(--hr-shadow);
    margin-bottom: 28px;
}
.hero h1 {
    font-size: 38px;
    margin: 0 0 12px;
    letter-spacing: 0.5px;
}
.hero p {
    font-size: 17px;
    opacity: 0.95;
    max-width: 640px;
    margin: 0 auto 24px;
}

/* ---------- Secciones ---------- */
section { margin: 32px 0; }
.section-title {
    font-size: 22px;
    margin: 0 0 18px;
    color: var(--hr-navy);
    border-left: 5px solid var(--hr-cyan);
    padding-left: 12px;
}

/* ---------- Grid de productos ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.product-card {
    background: var(--hr-surface);
    border-radius: var(--hr-radius);
    overflow: hidden;
    box-shadow: var(--hr-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s, box-shadow 0.18s;
    border: 1px solid var(--hr-border);
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hr-shadow-hover);
    border-color: var(--hr-cyan);
}
.product-card .img-wrap {
    aspect-ratio: 1 / 1;
    background: #eef3fb;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card .img-wrap img {
    width: 100%; height: 100%; object-fit: cover;
}
.product-card .info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.product-card .name {
    font-weight: 600;
    color: var(--hr-navy);
    font-size: 15px;
    line-height: 1.3;
    min-height: 38px;
}
.product-card .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--hr-blue);
}
.product-card .badge-stock {
    font-size: 11px;
    color: var(--hr-success);
    font-weight: 600;
}
.product-card .badge-stock.out { color: var(--hr-danger); }
.product-card .actions {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    gap: 6px;
}

/* ---------- Detalle de producto ---------- */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    background: #fff;
    border-radius: var(--hr-radius);
    padding: 28px;
    box-shadow: var(--hr-shadow);
}
.product-detail .img-wrap {
    background: #eef3fb;
    border-radius: var(--hr-radius);
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.product-detail .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-detail h1 { color: var(--hr-navy); margin: 0 0 8px; }
.product-detail .price { font-size: 32px; color: var(--hr-blue); font-weight: 700; }
.product-detail .desc { color: var(--hr-muted); line-height: 1.55; }

@media (max-width: 720px) {
    .product-detail { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
    .navbar-inner { flex-wrap: wrap; }
    .nav-search { order: 3; flex-basis: 100%; max-width: 100%; }
}

/* ---------- Formularios ---------- */
.card-form {
    background: #fff;
    max-width: 460px;
    margin: 40px auto;
    border-radius: var(--hr-radius);
    box-shadow: var(--hr-shadow);
    padding: 32px;
    border-top: 4px solid var(--hr-cyan);
}
.card-form h1 {
    color: var(--hr-navy);
    margin: 0 0 8px;
    font-size: 24px;
    text-align: center;
}
.card-form .subtitle {
    text-align: center;
    color: var(--hr-muted);
    margin-bottom: 22px;
}

.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--hr-navy);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--hr-radius);
    border: 1px solid var(--hr-border);
    font-size: 14px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--hr-cyan);
    box-shadow: 0 0 0 3px rgba(77, 196, 255, 0.25);
}
textarea.form-control { resize: vertical; min-height: 100px; }

.form-error { color: var(--hr-danger); font-size: 12px; margin-top: 4px; }
.form-foot {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--hr-muted);
}

/* ---------- Tabla de carrito / pedidos ---------- */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--hr-radius);
    overflow: hidden;
    box-shadow: var(--hr-shadow);
}
.table th, .table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--hr-border);
}
.table th {
    background: var(--hr-navy);
    color: #fff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tr:last-child td { border-bottom: none; }
.table tfoot td { font-weight: 700; background: #f5f8fc; }

.qty-input {
    width: 60px;
    padding: 6px;
    text-align: center;
    border: 1px solid var(--hr-border);
    border-radius: 6px;
}

/* ---------- Estados (badges) ---------- */
.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.status-pendiente { background: #fef3c7; color: #92400e; }
.status-pagado    { background: #d1fae5; color: #065f46; }
.status-enviado   { background: #dbeafe; color: #1e3a8a; }
.status-entregado { background: #c7d2fe; color: #312e81; }
.status-cancelado { background: #fee2e2; color: #991b1b; }

/* ---------- Footer ---------- */
.footer {
    background: var(--hr-navy-dark);
    color: #c8d6ef;
    margin-top: 60px;
    padding: 28px 20px;
    text-align: center;
    font-size: 13px;
}
.footer a { color: var(--hr-cyan); }

/* ---------- Filtros / barra lateral categorías ---------- */
.shop-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
}
.sidebar {
    background: #fff;
    border-radius: var(--hr-radius);
    box-shadow: var(--hr-shadow);
    padding: 18px;
    height: fit-content;
}
.sidebar h3 {
    margin: 0 0 12px;
    color: var(--hr-navy);
    font-size: 16px;
    border-bottom: 2px solid var(--hr-cyan);
    padding-bottom: 6px;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li a {
    display: block;
    padding: 6px 4px;
    color: var(--hr-text);
    border-radius: 6px;
}
.sidebar li a:hover, .sidebar li a.active {
    background: var(--hr-cyan-soft);
    color: var(--hr-navy);
}

@media (max-width: 720px) {
    .shop-layout { grid-template-columns: 1fr; }
}

/* ---------- Avisos ---------- */
.empty-state {
    background: #fff;
    border-radius: var(--hr-radius);
    padding: 40px 20px;
    text-align: center;
    color: var(--hr-muted);
    box-shadow: var(--hr-shadow);
}
.empty-state h2 { color: var(--hr-navy); margin-top: 0; }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}
.wa-float:hover {
    transform: scale(1.1) rotate(-8deg);
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.65);
    color: #fff;
}
.wa-float svg { width: 32px; height: 32px; }
.wa-float-tooltip {
    position: absolute;
    right: 72px;
    background: var(--hr-navy);
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateX(8px);
    box-shadow: var(--hr-shadow);
}
.wa-float:hover .wa-float-tooltip { opacity: 1; transform: translateX(0); }

/* ---------- Galería de imágenes ---------- */
.gallery {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
}
.gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gallery-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--hr-border);
    cursor: pointer;
    transition: border-color 0.15s;
}
.gallery-thumb.active, .gallery-thumb:hover {
    border-color: var(--hr-cyan);
}
.gallery-main {
    background: #eef3fb;
    border-radius: var(--hr-radius);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.gallery-main:hover img { transform: scale(1.05); }

@media (max-width: 720px) {
    .gallery { grid-template-columns: 1fr; }
    .gallery-thumbs { flex-direction: row; overflow-x: auto; }
}

/* ---------- Estrellas (rating) ---------- */
.stars {
    display: inline-flex;
    gap: 2px;
    font-size: 16px;
    line-height: 1;
}
.star-on { color: #f59e0b; }
.star-off { color: #d4d4d8; }

/* ---------- Tags de compatibilidad ---------- */
.compat-tag {
    display: inline-block;
    background: #eef3fb;
    color: var(--hr-navy);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    margin: 2px 4px 2px 0;
    border: 1px solid var(--hr-border);
}

/* ---------- Banner / Carrusel ---------- */
.banner-carousel {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--hr-shadow);
    margin-bottom: 28px;
}
.banner-slide {
    display: flex;
    align-items: center;
    background: linear-gradient(120deg, var(--hr-navy), var(--hr-blue), var(--hr-cyan));
    color: #fff;
    padding: 40px;
    min-height: 220px;
}
.banner-slide-text { flex: 1; }
.banner-slide-text h2 { margin: 0 0 8px; font-size: 28px; }
.banner-slide-text p { margin: 0 0 14px; opacity: 0.92; }
.banner-slide-img {
    flex: 0 0 auto;
    max-width: 40%;
    max-height: 200px;
    border-radius: 12px;
    overflow: hidden;
}

/* ---------- Wishlist button ---------- */
.wishlist-btn {
    background: #fff;
    border: 1px solid var(--hr-border);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--hr-muted);
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.wishlist-btn:hover { color: #e11d48; border-color: #e11d48; }
.wishlist-btn.active { color: #e11d48; border-color: #e11d48; background: #fff1f2; }
