
/* Reseteo básico y tipografía */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    -webkit-tap-highlight-color: transparent;
}

html { 
    scroll-behavior: smooth; 
    scroll-padding-top: 140px; 
}

body { 
    background-color: #f4f7f6; 
    color: #333333; 
    line-height: 1.5; 
    overflow-x: hidden;
}

/* Navegación Principal */
header { 
    background-color: #ff9800; 
    color: #fff; 
    padding: 0.8rem 1.2rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: relative;
    z-index: 1100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
header img { max-height: 45px; width: auto; }

.cart-btn { 
    background: #fff; 
    color: #ff9800; 
    border: none; 
    padding: 0.6rem 1rem; 
    border-radius: 50px; 
    cursor: pointer; 
    font-weight: bold; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.cart-btn:active { transform: scale(0.95); }

/* BARRA DE CATEGORÍAS FIJA */
.category-nav-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    padding: 12px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.category-pills {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 0 15px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}
.category-pills::-webkit-scrollbar { display: none; }

.pill-item {
    text-decoration: none;
    background: #f0f2f5;
    color: #555;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    scroll-snap-align: center;
}

.pill-item.active {
    background: #ff9800;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Secciones de Categoría */
.category-section { scroll-margin-top: 20px; }
.category-section h2 { 
    padding: 10px 15px; 
    border-left: 5px solid #ff9800; 
    background: #fff;
    margin: 30px 10px 15px;
    border-radius: 0 8px 8px 0;
    font-size: 1.2rem;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.02);
}

/* Grilla de Productos */
.container { max-width: 1200px; margin: 1rem auto; padding: 0 10px; }
.product-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
}
@media(min-width: 768px) { 
    .product-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } 
}
@media(min-width: 1024px) { 
    .product-grid { grid-template-columns: repeat(4, 1fr); } 
}

.product-card { 
    background: #fff; 
    border-radius: 12px; 
    padding: 12px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); 
    text-align: center; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.product-card img { 
    width: 100%; 
    height: 140px; 
    object-fit: cover; 
    border-radius: 8px; 
    margin-bottom: 8px;
}

.product-card h3 { 
    font-size: 0.9rem; 
    margin: 5px 0; 
    color: #333;
    height: 2.6rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card .price { 
    font-size: 1.1rem; 
    color: #ff9800; 
    font-weight: 800; 
    margin: 8px 0 12px; 
}

/* Selector de Cantidad */
.qty-selector {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f8f9fa !important;
    border-radius: 50px !important;
    padding: 3px !important;
    width: fit-content !important;
    margin: 0 auto 12px !important;
    border: 1px solid #eee !important;
}

.qty-btn {
    background: #fff !important;
    border: none !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    color: #333 !important;
}

.qty-input {
    width: 35px !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 15px !important;
    pointer-events: none;
}

/* Botón Añadir */
.add-to-cart { 
    background-color: #333333; 
    color: #fff; 
    border: none; 
    padding: 0.7rem; 
    border-radius: 10px; 
    cursor: pointer; 
    width: 100%; 
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
}

/* Sidebar del Carrito - AJUSTE DE CABECERA */
#cart-sidebar { 
    position: fixed; 
    right: -100%; 
    top: 0; 
    width: 85%; 
    max-width: 350px; 
    height: 100%; 
    background: #fff; 
    box-shadow: -5px 0 15px rgba(0,0,0,0.1); 
    transition: right 0.3s ease-in-out; 
    padding: 1.5rem; 
    z-index: 2000; 
    display: flex;
    flex-direction: column;
}
#cart-sidebar.open { right: 0; }

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #f4f7f6;
    margin-bottom: 15px;
}

.cart-header h3 {
    font-size: 1.2rem;
    color: #333333;
}

.close-cart {
    background: #f0f2f5;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.close-cart:hover { background: #e4e6e9; color: #333; }

/* Botones de Pago */
.checkout-btn { 
    display: block; 
    width: 100%; 
    text-align: center; 
    padding: 1rem; 
    margin-top: 10px; 
    text-decoration: none; 
    border-radius: 12px; 
    font-weight: bold; 
    color: #fff; 
    transition: filter 0.2s;
}
.btn-wa { background-color: #25D366; }
.btn-mp { background-color: #009EE3; }
.checkout-btn:active { filter: brightness(0.9); }