/* ==========================================
   MOTOFLASH - CATALOGO MAYORISTA (CARACAS)
   Sistema visual: TOP RACE - negro premium + dorado racing
========================================== */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700;800&family=Rubik:wght@400;500;600;700;800&display=swap');

:root {
    --color-bg: #181818;
    --color-surface: #FFFFFF;
    --color-surface-secondary: #F0EEEB;
    --color-fill: #F6F5F3;
    --color-fg: #1C1917;
    --color-fg-secondary: #57534E;
    --color-fg-tertiary: #A8A29E;
    --color-separator: #D6D3D1;
    --color-hairline: #E7E5E4;
    --color-dark: #1C1917;
    --color-dark-soft: #292524;
    --color-accent: #FF0000;
    --color-accent-hover: #CC0000;
    --color-accent-pressed: #990000;
    --color-gold: #FF0000;
    --color-gold-bright: #FF0000;
    --color-focus: rgba(255, 0, 0, 0.35);
    --color-success: #16A34A;
    --color-success-hover: #15803D;
    --color-red: #DC2626;
    --color-red-text: #B91C1C;
    --color-red-bg: rgba(220, 38, 38, 0.08);
    --color-whatsapp: #16A34A;
    --color-whatsapp-hover: #15803D;
    --font-heading: "Rubik", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 980px;
    --shadow-card: 0 1px 2px rgba(28, 25, 23, 0.05), 0 1px 8px rgba(28, 25, 23, 0.06);
    --shadow-float: 0 12px 32px rgba(28, 25, 23, 0.16);
    --shadow-gold: 0 6px 22px rgba(255, 0, 0, 0.3);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   ESTILOS BASE
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    max-width: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-fg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 120px;
    font-size: 16px;
    line-height: 1.5;
}

button,
select,
input {
    font-family: inherit;
}

button {
    touch-action: manipulation;
    cursor: pointer;
}

:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--color-focus);
    border-radius: var(--radius-sm);
}

/* ==========================================
   HEADER - BARRA NAV OSCURA (estilo racing)
========================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    padding: 0.5rem 0;
}

.container-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    display: block;
    height: 38px;
    width: auto;
    border-radius: 7px;
}

.mobile-banner {
    display: none;
}

.mobile-banner-img {
    display: block;
    width: 73%;
    height: auto;
    margin: 0 auto;
    border-radius: 7px;
    padding-top: 7%;
}

/* ==========================================
   BUSQUEDA RAPIDA - barra destacada
========================================== */
.quick-search-desktop {
    background: #181818;
    padding: 0.9rem 0;
    position: sticky;
    bottom: 0;
    z-index: 98;
}

.quick-search-wrap {
    position: relative;
    width: 250px;
    height: 50px;
    margin: 0 auto;
}

.quick-search-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    height: 100%;
    padding: 0 0.8rem 0 1.1rem;
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F0F0 100%);
    border-radius: 40px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.quick-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--color-fg);
}

.quick-search-input::placeholder {
    color: #BDB8AE;
}

.quick-search-lupa {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0.2rem;
    color: #FF0000;
    cursor: pointer;
    transition: transform 0.15s var(--ease);
}

.quick-search-lupa:active {
    transform: scale(0.9);
}

.quick-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-float);
    z-index: 200;
    padding: 0.4rem;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #FF0000 transparent;
}

.quick-search-dropdown.show {
    display: block;
}

.quick-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: none;
    border-bottom: 1px solid var(--color-hairline);
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.quick-search-item:last-child {
    border-bottom: none;
}

.quick-search-item:active {
    background: var(--color-surface-secondary);
}

.quick-search-item-name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    color: var(--color-fg);
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.quick-search-item-sku {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: var(--color-fg-tertiary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.category-sticky {
    display: none;
    position: sticky;
    top: 55px;
    z-index: 95;
    background: #181818;
    color: #F2EDE3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.55rem 1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

.category-sticky.show {
    display: block;
}

.category-sticky::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 16px;
    border-radius: 3px;
    background: #FF0000;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.clear-filter-row {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
}

.clear-filter-link {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    color: #FF0000;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

body.has-cart .quick-search-desktop {
    bottom: 84px;
}

.quick-search-desktop .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 0.8rem;
}

.sku-input {
    flex: 1;
    min-width: 0;
    color: var(--color-fg);
    padding: 0.8rem 1.3rem 0.8rem 3rem;
    border: 2px solid var(--color-hairline);
    border-radius: var(--radius-full);
    font-size: 1rem;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23A8A29E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 1rem 50%;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.sku-input::placeholder {
    color: var(--color-fg-tertiary);
}

.sku-input:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 4px var(--color-focus), 0 6px 20px rgba(255, 0, 0, 0.18);
}

/* ==========================================
   CONTENEDOR PRINCIPAL
========================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-icon {
    color: var(--color-fg-tertiary);
    margin-bottom: 1.2rem;
}

.no-results h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
    color: #F2EDE3;
}

.no-results p {
    color: #BDB5A4;
    margin-bottom: 1.5rem;
}

.btn-reset-filters {
    background: var(--color-red-bg);
    color: var(--color-red-text);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.btn-reset-filters:hover {
    background: rgba(220, 38, 38, 0.14);
}

.btn-reset-filters:active {
    transform: scale(0.97);
}

/* ==========================================
   CATEGORIAS Y PRODUCTOS - cards premium
========================================== */
.category-section {
    margin-bottom: 2.4rem;
}

.category-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    padding: 0 0.2rem;
    color: #F2EDE3;
    margin-bottom: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.category-title::before {
    content: "";
    width: 5px;
    height: 20px;
    border-radius: 3px;
    flex-shrink: 0;
    background: #FF0000;
    margin-right: 0.1rem;
}


.products-grid {
    display: grid;
    gap: 1rem;
    padding: 0;
    min-width: 0;
}

.product-card {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
    box-shadow: var(--shadow-card);
    transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}


.product-card:hover {
    background: var(--color-surface-secondary);
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
    gap: 0.8rem;
}

.product-name-section {
    flex: 1;
    min-width: 0;
}

.product-sku {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 0.2rem;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
}

.product-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-fg);
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
    line-height: 1.35;
    overflow-wrap: break-word;
    word-break: break-word;
}

.product-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.badge {
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.badge-type {
    background: rgba(255, 0, 0, 0.1);
    color: var(--color-accent);
}

.badge-material {
    background: #FF0000;
    color: #FFFFFF;
}

.product-pricing {
    position: relative;
    background: var(--color-fill);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    margin-top: 0.5rem;
}

.price-title {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    color: var(--color-accent);
    margin-bottom: 0.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    gap: 0.8rem;
}

.price-row:not(:last-child) {
    border-bottom: 1px solid var(--color-hairline);
}

.price-label {
    color: var(--color-fg-secondary);
    white-space: nowrap;
}

.price-value {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-fg);
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.price-unit {
    font-size: 0.75rem;
    color: var(--color-fg-tertiary);
    margin-left: 0.2rem;
    font-weight: 400;
}

.product-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.add-btn {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 2px solid var(--color-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-gold);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.28);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}

.add-btn:hover {
    background: rgba(255, 0, 0, 0.08);
    border-color: var(--color-gold);
}

.add-btn:active {
    transform: scale(0.92);
}

.add-btn.added {
    background: var(--color-success);
    color: #FFFFFF;
    border-color: var(--color-success);
}

.add-btn.added:hover {
    background: var(--color-success-hover);
    border-color: var(--color-success-hover);
}

.quantity-controls {
    background: var(--color-surface);
    border: 1px solid var(--color-separator);
    border-radius: var(--radius-full);
    display: none;
    align-items: center;
    padding: 3px;
}

.quantity-controls.active {
    display: flex;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--color-surface-secondary);
    color: var(--color-accent);
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s var(--ease);
}

.quantity-btn:hover {
    background: #E5E2DE;
}

.quantity-display {
    margin: 0 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-fg);
    min-width: 36px;
    text-align: center;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.product-badge-count {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 2;
    background: #FF0000;
    color: #FFFFFF;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 6px rgba(28, 25, 23, 0.35);
}

.product-badge-count.active {
    display: flex;
}

/* ==========================================
   BARRA FIJA CARRITO - oscura premium
========================================== */
.cart-summary-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(28, 25, 23, 0.94);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom));
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    gap: 1rem;
}

.cart-summary-bar.active {
    display: flex;
}

.cart-summary-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.cart-items-count {
    background: #FF0000;
    color: #FFFFFF;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.cart-summary-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cart-total {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #FFFFFF;
    font-size: 1.1rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cart-units {
    font-size: 0.75rem;
    color: #D6D3D1;
}

.view-cart-btn {
    background: #FF0000;
    color: #FFFFFF;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-full);
    font-weight: 800;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: filter 0.2s var(--ease), transform 0.15s var(--ease);
}

.view-cart-btn:hover {
    filter: brightness(1.08);
}

.view-cart-btn:active {
    filter: brightness(0.94);
    transform: scale(0.97);
}

/* ==========================================
   BOTON FILTRO POR CATEGORIA (MOBILE)
========================================== */
.category-fab {
    display: none;
    position: fixed;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 950;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: var(--radius-full);
    background: #FF0000;
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    white-space: nowrap;
    box-shadow: var(--shadow-float), 0 4px 18px rgba(255, 0, 0, 0.35);
    transition: transform 0.15s var(--ease), bottom 0.25s var(--ease), box-shadow 0.2s var(--ease);
    touch-action: manipulation;
}

.category-fab svg {
    color: #FFFFFF;
    flex-shrink: 0;
}

.category-fab:active {
    transform: translateX(-50%) scale(0.95);
}

body.has-cart .category-fab {
    bottom: calc(96px + env(safe-area-inset-bottom));
}

/* ==========================================
   MODAL FILTRO POR CATEGORIA (MOBILE)
========================================== */
.category-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(28, 25, 23, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), visibility 0s linear 0.25s;
}

.category-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.25s var(--ease);
}

.category-modal-sheet {
    width: 100%;
    max-width: 560px;
    max-height: min(72dvh, 640px);
    background: var(--color-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(32px);
    transition: transform 0.3s var(--ease);
    box-shadow: 0 -12px 40px rgba(28, 25, 23, 0.28);
}

.category-modal.active .category-modal-sheet {
    transform: translateY(0);
}

.category-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem 0.8rem;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-hairline);
    flex-shrink: 0;
}

.category-modal-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-fg);
}

.category-modal-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--color-surface-secondary);
    color: var(--color-fg-secondary);
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
    flex-shrink: 0;
}

.category-modal-close:active {
    transform: scale(0.92);
}

.category-chips {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1rem 1.25rem 0.9rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #FF0000 transparent;
}

.category-chips::-webkit-scrollbar {
    width: 6px;
}

.category-chips::-webkit-scrollbar-thumb {
    background: #FF0000;
    border-radius: 3px;
}.filter-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem 0.4rem;
    flex-shrink: 0;
}

.filter-tab {
    flex: 1;
    min-height: 40px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-full);
    background: var(--color-surface-secondary);
    color: var(--color-fg-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.filter-tab.active {
    background: #FF0000;
    border-color: transparent;
    color: #FFFFFF;
}.letter-panel {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.6rem 1rem 0.9rem;
}

.category-modal-sheet.letter-mode .category-chips {
    display: none;
}

.category-modal-sheet.letter-mode .letter-panel {
    display: flex;
    align-items: stretch;
    gap: 1rem;
}

.letter-products {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #FF0000 transparent;
    padding-right: 0.4rem;
}

.letter-products::-webkit-scrollbar {
    width: 6px;
}

.letter-products::-webkit-scrollbar-thumb {
    background: #FF0000;
    border-radius: 3px;
}

.letter-product-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.5rem;
    border: none;
    border-bottom: 1px solid var(--color-hairline);
    background: transparent;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--color-fg);
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.letter-product-item:active {
    background: rgba(255, 0, 0, 0.1);
}

.letter-index {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 52px;
    flex-shrink: 0;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #FF0000 transparent;
}

.letter-index::-webkit-scrollbar {
    width: 6px;
}

.letter-index::-webkit-scrollbar-thumb {
    background: #FF0000;
    border-radius: 3px;
}

.letter-index-btn {
    flex-shrink: 0;
    min-height: 34px;
    padding: 0.2rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-fg);
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s var(--ease);
}

.letter-index-btn:not(:disabled):active {
    background: rgba(255, 0, 0, 0.12);
}

.letter-index-btn:disabled {
    color: var(--color-fg-tertiary);
    opacity: 0.4;
    cursor: default;
}

.category-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    background: var(--color-surface-secondary);
    color: var(--color-fg);
    font-weight: 600;
    font-size: clamp(0.72rem, 0.68rem + 0.5vw, 0.9rem);
    line-height: 1.35;
    text-align: left;
    min-width: 0;
    transition: transform 0.15s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.category-chip-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}


.category-chip:active {
    transform: scale(0.97);
}

.category-chip.selected {
    background: #FF0000;
    border-color: transparent;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(255, 0, 0, 0.32);
}



.category-modal-search {
    padding: 0.8rem 1.25rem calc(0.8rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--color-hairline);
    flex-shrink: 0;
}

.category-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.category-search-row .sku-input {
    flex: 1;
    min-width: 0;
    min-height: 50px;
}

.category-search-btn {
    flex-shrink: 0;
    min-height: 50px;
    padding: 0 1.3rem;
    border: none;
    border-radius: var(--radius-full);
    background: #FF0000;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.2s var(--ease), transform 0.15s var(--ease);
}

.category-search-btn:active {
    transform: scale(0.96);
}

/* ==========================================
   SIDEBAR CARRITO - sheet iOS
========================================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    height: 100dvh;
    background: var(--color-surface-secondary);
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    z-index: 2000;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cart-sidebar.active {
    transform: translateX(0);
}

.cart-sidebar-header {
    padding: 1rem 1rem 0.9rem;
    border-bottom: 1px solid var(--color-hairline);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cart-sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.close-sidebar {
    background: var(--color-surface-secondary);
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--color-fg-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.2s var(--ease);
}

.close-sidebar:hover {
    background: #E5E2DE;
}

/* Segmented control estilo iOS */
.delivery-options {
    display: flex;
    gap: 0.4rem;
    padding: 0 1rem 0.9rem;
}

.delivery-option {
    flex: 1;
    min-height: 44px;
    padding: 0.65rem 0.5rem;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-fg-secondary);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s var(--ease);
}

.delivery-option.active {
    border-color: var(--color-gold);
    background: #FF0000;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

.address-field {
    padding: 0 1rem 0.9rem;
    display: none;
}

.address-field.show {
    display: block;
}

.address-input {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 1rem;
    color: var(--color-fg);
    border: 1px solid var(--color-separator);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--color-surface);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.address-input::placeholder {
    color: var(--color-fg-tertiary);
}

.address-input:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 4px var(--color-focus);
}

.cart-items-list {
    padding: 0 1rem 0.6rem;
}

.cart-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    margin-bottom: 0.55rem;
    box-shadow: var(--shadow-card);
}

.cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.cart-item-remove-row {
    display: flex;
    justify-content: flex-end;
}

.cart-item-remove {
    background: none;
    border: none;
    padding: 0.15rem 0.3rem;
    color: var(--color-red-text);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-fg);
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
    overflow-wrap: break-word;
    word-break: break-word;
}


.cart-item-price {
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.cart-item-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-hairline);
    background: var(--color-surface);
    color: var(--color-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    transition: background-color 0.2s var(--ease);
}

.cart-item-qty-btn:hover {
    background: var(--color-surface-secondary);
}

.cart-item-quantity {
    font-family: var(--font-heading);
    font-weight: 600;
    min-width: 32px;
    text-align: center;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.cart-sidebar-footer {
    padding: 0.7rem 0.8rem calc(0.7rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--color-hairline);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    position: sticky;
    bottom: 0;
}

.pricing-summary {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    box-shadow: var(--shadow-card);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--color-fg-secondary);
    font-variant-numeric: tabular-nums;
}

.total-row {
    border-top: 1px solid var(--color-separator);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-fg);
    letter-spacing: -0.02em;
}

.units-badge {
    background: rgba(255, 0, 0, 0.1);
    padding: 0.35rem;
    border-radius: var(--radius-full);
    text-align: center;
    color: var(--color-accent);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    font-variant-numeric: tabular-nums;
}

.payment-data {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.6rem;
    box-shadow: var(--shadow-card);
}

.payment-data-item + .payment-data-item {
    border-top: 1px solid var(--color-hairline);
    margin-top: 0.4rem;
    padding-top: 0.4rem;
}

.payment-copy-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0.45rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--color-accent);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.payment-copy-btn:hover {
    background: var(--color-surface-secondary);
}

.payment-copy-btn:active {
    transform: scale(0.98);
}

.payment-copy-icon {
    flex-shrink: 0;
    color: var(--color-accent);
}

.payment-accordion {
    margin-bottom: 0;
}

.payment-accordion-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #181818;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    box-shadow: var(--shadow-card);
    transition: background-color 0.2s var(--ease);
}

.payment-accordion-toggle:hover {
    background: #2A2418;
}

.payment-accordion-icon {
    flex-shrink: 0;
    transition: transform 0.25s var(--ease);
}

.payment-accordion.open .payment-accordion-icon {
    transform: rotate(180deg);
}

.send-whatsapp-btn {
    background: var(--color-whatsapp);
    color: #FFFFFF;
    border: none;
    padding: 0.7rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    font-size: 0.95rem;
    transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-whatsapp-btn:hover {
    background: var(--color-whatsapp-hover);
}

.send-whatsapp-btn:active {
    transform: scale(0.98);
}

/* ==========================================
   RESPONSIVE - MOBILE
========================================== */
@media (max-width: 768px) {
    body {
        padding-bottom: 210px;
    }

    .mobile-banner {
        display: block;
    }

    .header {
        display: none;
    }

    .category-sticky {
        top: 0;
    }

    .payment-accordion {
        margin-bottom: 0.6rem;
    }

    .payment-accordion-toggle {
        display: flex;
    }

    .payment-accordion-body {
        display: none;
        margin-top: 0.5rem;
    }

    .payment-accordion.open .payment-accordion-body {
        display: block;
    }

    .quick-search-desktop {
        position: static;
        padding: 0.7rem 0;
        box-shadow: none;
    }

    .quick-search-wrap {
        width: 90%;
    }


    .quick-search-desktop .container {
        gap: 0;
    }

    .sku-input {
        min-height: 50px;
        font-size: 1rem;
        padding: 0.9rem 1.3rem 0.9rem 3rem;
    }

    .category-fab {
        display: inline-flex;
    }

    .category-modal {
        display: flex;
    }

    .products-grid {
        border-radius: 0;
        padding: 0;
        gap: 0.8rem;
    }

    .product-card {
        flex-direction: column;
        padding: 1rem;
    }

    .product-controls {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
    }

    .category-title {
        font-size: 1.2rem;
    }
}

/* ==========================================
   DESKTOP
========================================== */
@media (min-width: 769px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
    }

    .category-fab,
    .category-modal {
        display: none;
    }
}

/* ==========================================
   ACCESIBILIDAD: motion reducido
========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
