/* =============================================================
   LLANTERA PADILLA — Shared Components
   ============================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea {
    font-family: var(--font-body);
    font-size: 15px;
}
select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2355565C' stroke-width='2.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px !important;
}
select option {
    padding: 12px 14px;
    font-size: 15px;
    min-height: 44px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-headline);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 13px;
    padding: 12px 20px;
    border-radius: var(--r-md);
    border: none;
    transition: all var(--dur-fast) var(--ease-snap);
}

.btn-primary {
    background: var(--flame-500);
    color: #fff;
    box-shadow: var(--shadow-flame);
}
.btn-primary:hover { background: var(--flame-600); }
.btn-primary:active { transform: scale(.98); background: var(--flame-700); }

.btn-ghost {
    background: transparent;
    color: var(--fg);
    border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }

.btn-dark {
    background: var(--shop-950);
    color: #fff;
}

.btn-full { width: 100%; }

.btn-sm {
    padding: 8px 14px;
    font-size: 11px;
}

/* ---- Icon Button ---- */
.icon-btn {
    background: none;
    border: none;
    padding: 6px;
    color: var(--fg);
    position: relative;
}

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}

/* ---- Pill / Badge ---- */
.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pill-success { background: var(--success-bg); color: #1F6B3E; }
.pill-warning { background: var(--warning-bg); color: #8A5E05; }
.pill-danger  { background: var(--danger-bg); color: #8C1D0D; }
.pill-info    { background: var(--info-bg); color: #1A4E8C; }
.pill-flame   { background: rgba(242,92,31,.15); color: var(--flame-600); }
.pill-muted   { background: var(--surface-3); color: var(--fg-3); }

/* ---- Form ---- */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--fg-3);
    margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--fg);
    outline: none;
    transition: border-color var(--dur-fast) var(--ease-snap);
    min-height: 44px;
    font-size: 15px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--flame-500);
    box-shadow: 0 0 0 2px rgba(242,92,31,.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---- Section Head ---- */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 16px 10px;
}
.section-head h2 {
    font-family: var(--font-headline);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 15px;
    letter-spacing: .02em;
}
.section-head a {
    font-size: 12px;
    color: var(--flame-600);
    font-weight: 600;
}

/* ---- Chip row ---- */
.chip-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: var(--r-pill);
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--fg-3);
    cursor: pointer;
}
.chip.active {
    background: var(--shop-950);
    color: #fff;
    border-color: var(--shop-950);
}

/* ---- Cart badge ---- */
.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #F25C1F;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    pointer-events: none;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.cart-badge.visible {
    display: flex;
    text-align: center;
}

/* ---- Loading ---- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--fg-3);
    font-size: 13px;
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--fg-3);
}
.empty-state svg { margin: 0 auto 12px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ---- Toast ---- */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--shop-950);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all var(--dur-med) var(--ease-snap);
    box-shadow: var(--shadow-lg);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11,11,12,.6);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: none;
}
.modal-overlay.open { display: flex; align-items: flex-end; justify-content: center; }

.modal {
    background: var(--surface);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
}
.modal-title {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* ---- KPI Card ---- */
.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px;
}
.kpi-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-3);
    text-transform: uppercase;
    letter-spacing: .1em;
}
.kpi-value {
    font-family: var(--font-headline);
    font-style: italic;
    font-weight: 800;
    font-size: 28px;
    line-height: 1;
    margin-top: 4px;
}
.kpi-value.flame { color: var(--flame-500); }
.kpi-delta {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }

/* ---- Table ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--fg-3);
    font-weight: 600;
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.data-table tr:last-child td { border-bottom: 0; }
