:root {
    --bg-main: #ffffff;
    --bg-secondary: #fdfaf7;
    --text-main: #1a1a1a;
    --text-muted: #777;
    --accent: #d4a574;
    --whatsapp: #25D366;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Lato', sans-serif;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: clip; }   /* clip no rompe sticky, hidden sí */
body { overflow-x: clip; max-width: 100%; }
body { font-family: var(--font-body); color: var(--text-main); background: var(--bg-main); }
h1, h2, h3 { font-family: var(--font-heading); }

/* Header & Nav */
.header { position: sticky; top: 0; background: rgba(255,255,255,0.98); backdrop-filter: blur(10px); z-index: 100; border-bottom: 1px solid #eee; }
.header-container { display: flex; justify-content: space-between; align-items: center; padding: 0px 5%; max-width: 1400px; margin: 0 auto; }
.logo { font-family: var(--font-heading); font-size: 2.2rem; font-weight: 600; letter-spacing: 2px; cursor: pointer; }
.nav-icons { display: flex; gap: 25px; align-items: center; font-size: 1.3rem; }
.icon-badge { position: relative; cursor: pointer; transition: var(--transition); }
.icon-badge:hover { color: var(--accent); }
.badge-count { position: absolute; top: -8px; right: -10px; background: var(--accent); color: white; font-size: 0.7rem; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-body); }

/* Carousel */
.carousel { position: relative; width: 100%; height: 540px; overflow: hidden; background: #000; }
.carousel-inner { display: flex; width: 300%; height: 100%; transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.slide { width: 100%; height: 100%; position: relative; }
.slide img { width: 100%; height: 100%; object-fit: contain; object-position: center center; }
.slide-content { position: absolute; top: 50%; left: 8%; transform: translateY(-50%); color: white; max-width: 500px; }
.slide-content h2 { font-size: 3rem; line-height: 1; margin-bottom: 12px; }
.carousel-dots { display: none; }
.dot { display: none; }

/* ── Flechas carrusel — zona inferior centradas ── */
.carousel-arrow {
    position: absolute;
    bottom: 22px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.45);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.78rem;
    z-index: 10;
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.carousel-arrow:hover  { background: rgba(255,255,255,0.32); transform: scale(1.1); }
.carousel-arrow:active { transform: scale(0.95); }
.carousel-arrow.prev   { left: calc(50% - 45px); }
.carousel-arrow.next   { right: calc(50% - 45px); }
@media (max-width: 768px) {
    .carousel-arrow        { width: 30px; height: 30px; font-size: 0.72rem; bottom: 16px; }
    .carousel-arrow.prev   { left: calc(50% - 38px); }
    .carousel-arrow.next   { right: calc(50% - 38px); }
}

/* Layout */
.main-container { max-width: 1400px; margin: 0 auto; padding: 60px 5%; display: grid; grid-template-columns: 240px 1fr; gap: 50px; }
.sidebar h3 { font-size: 1.8rem; margin-bottom: 25px; border-bottom: 2px solid var(--bg-secondary); padding-bottom: 10px; }
.sidebar li { list-style: none; padding: 12px 0; cursor: pointer; color: var(--text-muted); transition: 0.3s; border-bottom: 1px solid #f9f9f9; }
.sidebar li.active, .sidebar li:hover { color: var(--accent); padding-left: 10px; font-weight: 600; }

/* Products */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 35px; }
.product-card { position: relative; background: #fff; transition: var(--transition); }
.product-card:hover { transform: translateY(-10px); }
.img-container { position: relative; height: 350px; overflow: hidden; border-radius: 4px; }
.product-img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.img-watermark { position: absolute; bottom: 8px; left: 8px; height: 40px; width: auto; object-fit: contain; mix-blend-mode: multiply; opacity: 0.85; pointer-events: none; z-index: 2; }
.agotado-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 3; pointer-events: none; backdrop-filter: blur(3px); }
.agotado-badge { color: #fff; font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; letter-spacing: 4px; border: 2px solid #fff; padding: 6px 18px; text-transform: uppercase; }
.product-card:hover .product-img { scale: 1.05; }
.fav-btn { position: absolute; top: 15px; right: 15px; background: white; border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; color: #ccc; transition: 0.3s; z-index: 5; }
.fav-btn.active { color: #e74c3c; }
.product-info { padding: 20px 0; text-align: center; }
.product-desc { font-size: 0.85rem; color: #666; line-height: 1.45; margin: 6px 10px 4px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.product-price { color: var(--accent); font-weight: bold; font-size: 1.2rem; margin: 8px 0; }
.btn-add { background: var(--text-main); color: white; border: none; padding: 12px; width: 100%; cursor: pointer; font-family: var(--font-body); font-weight: bold; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; }
.btn-add:hover { background: var(--accent); }

/* Footer Moderno */
.footer { background: #fafafa; padding: 80px 5% 40px; border-top: 1px solid #eee; margin-top: 80px; }
.footer-grid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; text-align: center; }
.footer-brand h2 { font-size: 2.5rem; margin-bottom: 15px; }
.social-icons { display: flex; justify-content: center; gap: 25px; margin-top: 20px; }
.social-icons a { font-size: 1.8rem; transition: 0.3s; }
.fa-instagram { color: #E4405F; }
.fa-facebook { color: #1877F2; }
.social-icons a:hover { transform: translateY(-5px); opacity: 0.8; }

.contact-minimal { display: flex; justify-content: center; gap: 30px; margin-top: 20px; }
.contact-minimal a { width: 50px; height: 50px; border-radius: 50%; border: 1px solid #ddd; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--text-main); transition: 0.3s; }
.contact-minimal a:hover { background: var(--text-main); color: white; border-color: var(--text-main); }

/* Modales & Sidebar */
.cart-sidebar { position: fixed; top: 0; right: -300px; width: 300px; height: 100vh; background: #fff; z-index: 1000; box-shadow: -10px 0 30px rgba(0,0,0,0.1); transition: 0.4s ease; display: flex; flex-direction: column; }
.cart-sidebar.open { right: 0; }
.cart-items { flex: 1; overflow-y: auto; padding: 30px; }
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); align-items: center; justify-content: center; }
.checkout-container { background: #fff; width: 95%; max-width: 1000px; display: flex; border-radius: 8px; overflow: hidden; max-height: 90vh; }

/* Estilo Tabla WhatsApp (Visto en anterior respuesta) */
.btn-whatsapp { background: var(--whatsapp); color: white; border: none; padding: 15px; width: 100%; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 1.1rem; border-radius: 5px; }

/* Fav Sidebar */
.fav-sidebar { position: fixed; top: 0; left: -300px; width: 300px; height: 100vh; background: #fff; z-index: 1000; box-shadow: 10px 0 30px rgba(0,0,0,0.1); transition: 0.4s ease; display: flex; flex-direction: column; }
.fav-sidebar.open { left: 0; }
.fav-items { flex: 1; overflow-y: auto; padding: 20px 25px; }
.fav-card { display: flex; gap: 15px; align-items: flex-start; padding: 15px 0; border-bottom: 1px solid #f0f0f0; }
.fav-card img { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.fav-card-info { flex: 1; min-width: 0; overflow: hidden; }
.fav-card-info h4 { font-family: var(--font-heading); font-size: 0.95rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-card-info p { color: var(--accent); font-weight: bold; font-size: 0.9rem; }
.fav-card-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.btn-fav-cart { background: var(--text-main); color: white; border: none; padding: 8px 12px; font-size: 0.78rem; font-family: var(--font-body); font-weight: bold; letter-spacing: 0.5px; text-transform: uppercase; cursor: pointer; transition: 0.3s; white-space: nowrap; border-radius: 2px; }
.btn-fav-cart:hover { background: var(--accent); }
.btn-fav-remove { background: none; border: none; color: #ccc; cursor: pointer; font-size: 1rem; transition: 0.3s; }
.btn-fav-remove:hover { color: #e74c3c; }
.fav-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.fav-empty i { font-size: 3rem; margin-bottom: 15px; color: #eee; display: block; }

/* ══════════════════════════════════════
   BARRA SUPERIOR MÓVIL (mob-topbar)
══════════════════════════════════════ */
.mob-topbar {
    display: none;          /* visible solo en móvil via media query */
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* — Fila buscador — */
.mob-search-row {
    padding: 10px 14px 8px;
    border-bottom: 1px solid #f0f0f0;
}
.mob-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.mob-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 0.85rem;
    pointer-events: none;
}
.mob-search-input {
    width: 100%;
    padding: 9px 36px 9px 36px;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    background: #fafafa;
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    color: var(--text-main);
    transition: border-color 0.2s, background 0.2s;
}
.mob-search-input:focus {
    border-color: var(--accent);
    background: #fff;
}
.mob-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    line-height: 1;
}

/* — Fila categorías con flechas — */
.mob-cat-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 0;
}
.mob-cat-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.mob-cat-arrow:hover  { color: var(--accent); }
.mob-cat-arrow:active { color: var(--accent); }
.mob-cat-scroll {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding: 2px 0;
}
.mob-cat-scroll::-webkit-scrollbar { display: none; }
.mob-cat-btn {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 50px;
    border: 1.5px solid #ddd;
    background: #fff;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.mob-cat-btn.active {
    background: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
}

/* ── Paginación ── */
.pagination-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 48px;
    padding-bottom: 16px;
}
.btn-load-more {
    background: var(--text-main);
    color: #fff;
    border: none;
    padding: 14px 48px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.25s;
    border-radius: 2px;
}
.btn-load-more:hover { background: var(--accent); }
.pagination-info {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

/* ══════════════════════════════════════
   RESPONSIVE MÓVIL — breakpoint 768px
══════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Header ── */
    .header-container {
        padding: 0 16px;
        min-height: 60px;
        overflow: visible;
    }
    .logo img  { height: 46px !important; }
    .logo span { font-size: 1.25rem; letter-spacing: 1px; }
    .nav-icons { gap: 18px !important; font-size: 1.15rem; }

    /* Buscador: ocultar en móvil dentro del header,
       aparece en la barra de categorías */
    .bc-search-wrap { display: none !important; }

    /* ── Carrusel ── */
    .carousel { height: 360px; }
    .slide-content { left: 5%; max-width: 75%; }
    .slide-content h2 { font-size: 1.6rem; line-height: 1.15; margin-bottom: 8px; }
    .slide-content p  { font-size: 0.78rem; margin-bottom: 10px; }

    /* ── Barra superior móvil: visible y sticky ── */
    .mob-topbar {
        display: flex;
        position: sticky;
        top: 60px;
        z-index: 95;
    }
    /* Ocultar buscador del header en móvil */
    .bc-search-wrap { display: none !important; }

    /* ── Layout ── */
    .main-container {
        grid-template-columns: 1fr;
        padding: 16px 12px 40px;
        gap: 0;
        /* evitar desbordamiento */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .sidebar { display: none; }

    /* ── Grid 2 columnas, nunca desborda ── */
    .product-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100%;
        min-width: 0;
    }
    .product-card { min-width: 0; overflow: hidden; }
    .img-container { height: 170px; }
    .product-info { padding: 8px 4px 6px; }
    .product-info h3 {
        font-size: 0.8rem;
        line-height: 1.25;
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .product-desc { display: none; }
    .product-price { font-size: 0.9rem; margin: 4px 0; }
    .btn-add {
        padding: 9px 4px;
        font-size: 0.68rem;
        letter-spacing: 0.3px;
    }
    .fav-btn { width: 28px; height: 28px; top: 6px; right: 6px; font-size: 0.7rem; }
    .agotado-badge { font-size: 0.85rem; letter-spacing: 1.5px; padding: 3px 8px; }
    .img-watermark { height: 22px; }

    /* ── Carrito y favoritos — full width ── */
    .cart-sidebar {
        width: 100% !important;
        right: -100% !important;
        max-width: 100vw;
    }
    .cart-sidebar.open { right: 0 !important; }
    .fav-sidebar {
        width: 100% !important;
        left: -100% !important;
        max-width: 100vw;
    }
    .fav-sidebar.open { left: 0 !important; }

    /* ── Checkout modal ── */
    .checkout-container {
        flex-direction: column;
        overflow-y: auto;
        width: 100%;
        max-width: 100vw;
        max-height: 95vh;
        border-radius: 0;
    }

    /* ── Paginación ── */
    .pagination-wrap { margin-top: 28px; }
    .btn-load-more { padding: 12px 32px; font-size: 0.82rem; width: 100%; }

    /* ── Footer ── */
    .footer { padding: 40px 5% 24px; }
    .footer-grid { gap: 24px; }
    .footer-brand h2 { font-size: 1.8rem; }
}

/* Pantallas muy pequeñas (≤ 380px) */
@media (max-width: 380px) {
    .logo span { display: none; }   /* solo el logo imagen */
    .carousel  { height: 260px; }
    .slide-content h2  { font-size: 1.3rem; }
    .slide-content p   { display: none; }
    .main-container    { padding: 12px 8px 32px; }
    .product-grid      { gap: 8px !important; }
    .img-container     { height: 145px; }
    .btn-add           { font-size: 0.64rem; padding: 8px 2px; }
}
