/* --- ROLOCODEPRE: ESTÉTICA SILICON VALLEY 2026 --- */
:root {
    --bg: #F2F2F7;
    --card-bg: #FFFFFF;
    --blue: #007AFF;
    --green: #34C759;
    --red: #FF3B30;
    --orange: #FF9500;
    --text-main: #1D1D1F;
    --text-sec: #86868B;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body { 
    background: var(--bg); 
    font-family: 'Inter', sans-serif; 
    color: var(--text-main);
    padding-bottom: 140px; 
    -webkit-font-smoothing: antialiased;
}

/* HEADER & SEARCH */
.header-container {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    background: rgba(242, 242, 247, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 20px 10px 20px;
}

.brand { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.logo-area { display: flex; align-items: center; gap: 10px; }
.logo { font-family: 'Manrope', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.logo span { color: var(--blue); }

.stock-badge {
    background: #E5E5EA; color: var(--text-sec);
    font-size: 10px; font-weight: 700; padding: 4px 8px;
    border-radius: 6px; letter-spacing: 0.5px; white-space: nowrap;
}

.cart-btn { position: relative; cursor: pointer; padding:5px; }
.badge { 
    position: absolute; top: -2px; right: -2px; background: var(--blue); color: #FFF; 
    font-size: 10px; font-weight: 800; width: 18px; height: 18px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.3s;
}
.badge.show { opacity: 1; }

.search-box { position: relative; width: 100%; }
.inp-search {
    width: 100%; padding: 12px 15px 12px 40px;
    border-radius: 12px; border: none; background: #FFF;
    font-size: 16px; color: var(--text-main); outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: 0.2s;
}
.inp-search:focus { box-shadow: 0 4px 12px rgba(0,122,255,0.15); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0.5; }

/* CHIPS CATEGORIAS */
.cats-wrapper {
    position: sticky; top: 118px; z-index: 900; background: var(--bg);
    padding: 10px 20px; overflow-x: auto; white-space: nowrap;
    -ms-overflow-style: none; scrollbar-width: none;
    border-bottom: 1px solid rgba(0,0,0,0.02);
}
.cats-wrapper::-webkit-scrollbar { display: none; }

.chip {
    display: inline-block; padding: 8px 16px; margin-right: 8px;
    background: #FFF; border-radius: 20px; font-size: 12px; font-weight: 700; 
    color: var(--text-sec); border: 1px solid rgba(0,0,0,0.05); transition: 0.2s; cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.chip.active { background: #1D1D1F; color: #FFF; border-color: #1D1D1F; transform: scale(1.02); }
.chip.promo-chip { background: linear-gradient(135deg, #FF9500, #FF3B30); color: white; border: none; }

/* GRILLA Y CARDS (ESTO ES LO QUE SE VEÍA MAL) */
.grid {
    padding: 150px 15px 20px 15px; 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); /* Ancho mínimo para que no se aplasten */
    gap: 12px;
    max-width: 1200px; margin: 0 auto;
}

.card {
    background: var(--card-bg); padding: 14px; border-radius: var(--radius);
    box-shadow: var(--shadow); 
    display: flex; flex-direction: column; /* Fundamental para alinear altura */
    height: 100%; 
    border: 1px solid rgba(0,0,0,0.03); 
    transition: transform 0.1s;
    position: relative;
    justify-content: space-between;
}
.card:active { transform: scale(0.98); }

/* Estructura Interna de la Card */
.c-content { margin-bottom: 10px; }

.c-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.c-cat { font-size: 9px; font-weight: 800; text-transform: uppercase; color: var(--blue); opacity: 0.9; letter-spacing: 0.5px; }

.tags-row { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.tag { font-size: 8px; font-weight: 800; padding: 3px 6px; border-radius: 4px; text-transform: uppercase; line-height: 1; }
.tag-new { background: #E3F2FD; color: #007AFF; }
.tag-drop { background: #E8F5E9; color: #34C759; }
.tag-promo { background: #FFF3E0; color: #FF9500; }

.c-title { 
    font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text-main); 
    margin-bottom: 8px; 
    /* Truco para cortar texto largo elegantemente */
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.c-note { 
    font-size: 10px; color: #666; background: #F2F2F7; 
    padding: 6px 8px; border-radius: 6px; margin-top: 5px; 
    line-height: 1.3; font-style: italic; display: block;
}

.c-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; border-top: 1px solid #F5F5F7; padding-top: 12px; }
.price { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 17px; letter-spacing: -0.5px; }
.price.consultar { font-size: 11px; color: var(--blue); text-transform: uppercase; }

.btn-add {
    width: 32px; height: 32px; border-radius: 50%; background: #1D1D1F; 
    color: #FFF; display: flex; align-items: center; justify-content: center; 
    font-weight: 700; cursor: pointer; border: none; font-size: 18px; transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-add:active { background: var(--blue); transform: scale(0.9); }

/* FAB & MODAL */
.fab {
    position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 150%);
    width: 90%; max-width: 450px; background: rgba(29, 29, 31, 0.95); backdrop-filter: blur(10px);
    color: #FFF; border-radius: 50px; padding: 12px 12px 12px 25px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3); z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer;
}
.fab.visible { transform: translate(-50%, 0); }
.fab-info { display: flex; flex-direction: column; line-height: 1.2; }
.fab-total { font-size: 18px; font-weight: 800; font-family: 'Manrope', sans-serif; }
.fab-btn { background: #FFF; color: #000; padding: 10px 20px; border-radius: 30px; font-size: 12px; font-weight: 800; }

.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 3000;
    display: none; justify-content: center; align-items: flex-end;
    backdrop-filter: blur(8px);
}
.modal.open { display: flex; animation: fadeIn 0.3s; }

.sheet {
    background: #FFF; width: 100%; max-width: 600px; 
    border-radius: 25px 25px 0 0; padding: 30px 25px;
    max-height: 90vh; overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #F0F0F0; }
.cart-controls { display: flex; align-items: center; gap: 10px; }
.btn-trash { color: var(--red); background: rgba(255,59,48,0.1); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; }

.inp-form {
    width: 100%; padding: 16px; background: #FAFAFA; border: 1px solid #E5E5EA;
    border-radius: 12px; margin-bottom: 12px; font-size: 16px; font-family: inherit;
    outline: none; transition: 0.2s;
}
.inp-form:focus { border-color: var(--blue); background: #FFF; }

.btn-whatsapp {
    width: 100%; padding: 18px; background: var(--green); color: white;
    border: none; border-radius: 16px; font-size: 16px; font-weight: 800;
    box-shadow: 0 10px 25px rgba(52, 199, 89, 0.3); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}

.btn-clear-all {
    background: #FFF0F0; color: var(--red); border: none; padding: 8px 14px;
    border-radius: 20px; font-size: 12px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; gap: 5px; transition: 0.2s;
}
.btn-clear-all:active { transform: scale(0.95); }

.disclaimer-box {
    background: #FFFBE6; border: 1px solid #FFE58F; color: #B7791F;
    padding: 12px; border-radius: 12px; font-size: 11px; font-weight: 600;
    text-align: center; margin-bottom: 20px; line-height: 1.4;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
