:root {
    --primary: #1a237e;
    --accent: #ff9800;
    --whatsapp: #25d366;
    --danger: #e53935;
    --text: #1c1c2e;
    --text-muted: #888;
    --bg: #f5f5f7;
    --white: #ffffff;
    --card-shadow: 0 2px 10px rgba(0,0,0,0.07);
    --radius: 12px;
    --transition: 0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
}

/* ── NAVBAR ── */
.navbar {
    background: var(--primary);
    padding: 0.9rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(26,35,126,0.25);
}

.logo {
    color: var(--white);
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 900;
}

.logo span { color: var(--accent); }

.cart-btn {
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.cart-btn:hover { background: rgba(255,255,255,0.22); }

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
    transition: transform 0.2s;
}

.cart-badge.pop { transform: scale(1.4); }

/* ── HERO ── */
.hero {
    background-image:
        linear-gradient(160deg, rgba(26, 35, 126, 0.82) 0%, rgba(0, 0, 0, 0.55) 100%),
        url('https://images.unsplash.com/photo-1534452203293-494d7ddbf7e0?auto=format&fit=crop&q=60&w=1200');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--white);
}

.hero-subtitle {
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 0.8rem;
}

.hero h1 em { color: var(--accent); font-style: normal; }
.hero-desc { font-size: 0.95rem; opacity: 0.85; margin-bottom: 1.5rem; }

.btn-primary {
    background: var(--whatsapp);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 15px rgba(37,211,102,0.35);
}

.btn-primary:hover { transform: translateY(-2px); }

/* ── SECTION TITLE ── */
.section-title {
    text-align: center;
    padding: 1.8rem 1rem 0.8rem;
}

.section-title h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.section-title p { color: var(--text-muted); font-size: 0.85rem; }

/* ── GRID ESTILO SHEIN ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 600px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 12px; }
}

@media (min-width: 900px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 16px; }
}

@media (min-width: 1200px) {
    .product-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ── PRODUCT CARD ── */
.product-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.product-info {
    padding: 8px 10px 10px;
}

.product-info h3 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 800;
}

.vendedor {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 4px;
}

.card-stock-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: #ffebee;
    color: #c62828;
}

.card-btn-add {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: filter var(--transition);
}

.card-btn-add:hover:not(:disabled) { filter: brightness(1.15); }
.card-btn-add:disabled { background: #ccc; cursor: not-allowed; }

/* ── MODAL OVERLAY ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(3px);
}

.modal-overlay[hidden] { display: none; }

/* ── MODAL CARRITO ── */
.modal-box {
    background: var(--white);
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.6rem;
    cursor: pointer;
    opacity: 0.8;
}

.modal-close:hover { opacity: 1; }

.modal-body { padding: 1rem; overflow-y: auto; flex: 1; }

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.88rem; }
.cart-item-price { font-size: 0.82rem; color: var(--primary); font-weight: 700; }

.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f7;
    border-radius: 20px;
    padding: 4px 6px;
}

.qty-btn {
    background: var(--white);
    border: 1px solid #ddd;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: background var(--transition), color var(--transition);
}

.qty-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-num { font-weight: 700; font-size: 0.9rem; min-width: 18px; text-align: center; }

.cart-empty { text-align: center; padding: 2rem; color: var(--text-muted); }
.cart-empty i { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.total-row strong { color: var(--primary); font-size: 1.25rem; }

.btn-whatsapp {
    background: var(--whatsapp);
    color: var(--white);
    border: none;
    padding: 13px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter var(--transition);
}

.btn-whatsapp:hover { filter: brightness(0.9); }

.btn-clear {
    background: none;
    border: 1px solid #e0e0e0;
    color: var(--text-muted);
    padding: 9px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color var(--transition), border-color var(--transition);
}

.btn-clear:hover { color: var(--danger); border-color: var(--danger); }

/* ── MODAL DETALLE ── */
#modal-detalle {
    align-items: flex-end;
    padding: 0;
}

.detalle-box {
    background: var(--white);
    width: 100%;
    max-width: 480px;
    height: 92vh;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.35s ease;
    position: relative;
}

.detalle-btn-cerrar {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: rgba(0,0,0,0.4);
    border: none;
    color: var(--white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.detalle-img-wrap {
    width: 100%;
    height: 55vw;
    max-height: 320px;
    flex-shrink: 0;
    overflow: hidden;
}

.detalle-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detalle-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
}

.detalle-vendedor {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.detalle-nombre {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 5px;
}

.detalle-precio {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 10px;
}

.detalle-stock {
    font-size: 0.78rem;
    padding: 3px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 600;
}

.detalle-stock.ok      { background: #e8f5e9; color: #2e7d32; }
.detalle-stock.low     { background: #fff3e0; color: #e65100; }
.detalle-stock.agotado { background: #ffebee; color: #c62828; }

.detalle-actions { margin-bottom: 1.5rem; }

.detalle-btn-add {
    width: 100%;
    background: var(--whatsapp);
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter var(--transition);
}

.detalle-btn-add:hover:not(:disabled) { filter: brightness(0.9); }
.detalle-btn-add:disabled { background: #ccc; cursor: not-allowed; }

/* ── RESEÑAS ── */
.resenas-section { border-top: 1px solid #f0f0f0; padding-top: 1.2rem; }

.resenas-titulo {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resenas-titulo i { color: var(--accent); }

.resenas-count {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.resena-form {
    background: var(--bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resena-form input,
.resena-form textarea {
    background: var(--white);
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 9px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition);
}

.resena-form input:focus,
.resena-form textarea:focus { border-color: var(--primary); }
.resena-form textarea { resize: none; }

.estrellas-input {
    display: flex;
    gap: 6px;
    padding: 4px 0;
}

.estrellas-input i {
    font-size: 1.4rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.15s;
}

.estrellas-input i.activa { color: var(--accent); }

.btn-enviar-resena {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter var(--transition);
}

.btn-enviar-resena:hover { filter: brightness(1.15); }

.resena-item {
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.resena-item:last-child { border-bottom: none; }

.resena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.resena-autor { font-weight: 600; font-size: 0.85rem; }

.resena-estrellas { color: var(--accent); font-size: 0.78rem; }

.resena-texto { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

.resena-fecha { font-size: 0.72rem; color: #bbb; margin-top: 3px; }

.resenas-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── TOAST ── */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
    align-items: center;
}

.toast-item {
    background: #25a244;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

.toast-item.show { opacity: 1; transform: translateY(0); }
.toast-item.warning { background: #ff9800; }
.toast-item.error   { background: #e53935; }
.toast-item.info    { background: #1a237e; }

/* ── SCROLLBAR ── */
.detalle-scroll::-webkit-scrollbar { width: 3px; }
.detalle-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

@media (min-width: 600px) {
    #modal-detalle { align-items: center; padding: 1rem; }
    .detalle-box { border-radius: 20px; height: auto; max-height: 88vh; }
    .detalle-img-wrap { height: 300px; max-height: 300px; }
}

/* Fix estrellas */
.estrellas-input {
    display: flex;
    gap: 8px;
    padding: 6px 0;
}

.estrellas-input i {
    font-size: 1.6rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.15s;
}

.estrellas-input i.activa {
    color: #ff9800;
}

/* ── FOOTER ── */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.85);
    margin-top: 3rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

@media (max-width: 700px) {
    .footer-top {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
        gap: 1.5rem;
    }
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 0.8rem;
}

.footer-logo span { color: var(--accent); }

.footer-desc {
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.75;
    margin-bottom: 1.2rem;
    max-width: 280px;
}

.footer-wa {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--whatsapp);
    color: var(--white);
    padding: 9px 18px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: filter var(--transition);
}

.footer-wa:hover { filter: brightness(0.9); }

.footer-links h4,
.footer-info h4 {
    font-family: 'Playfair Display', serif;
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent); }

.footer-info p {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    opacity: 0.75;
}

.footer-info i { color: var(--accent); width: 14px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    opacity: 0.6;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

@media (max-width: 500px) {
    .footer-bottom { flex-direction: column; text-align: center; }
}


/* ── SKELETON LOADER ── */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.product-card.skeleton { pointer-events: none; }

.skeleton-img,
.skeleton-line,
.skeleton-btn {
    background: linear-gradient(90deg, #e8e8ec 25%, #f4f4f7 50%, #e8e8ec 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 6px;
}

.skeleton-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius) var(--radius) 0 0;
}

.skeleton-line        { height: 14px; margin-bottom: 10px; }
.skeleton-line.short  { width: 45%; }
.skeleton-line.medium { width: 60%; }
.skeleton-btn         { height: 38px; margin-top: 8px; }

/* ── ESTADO VACÍO / ERROR ── */
.grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #999;
}

.grid-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}
