/* ================================================================
   CODEX · tienda.css — Hardware Store
   Requiere: css/styles.css cargado antes (variables CSS globales)
   ================================================================ */

/* ── Variables de respaldo por si styles.css no define alguna ── */
:root {
    --primary-glow: rgba(61, 0, 34, .08);
}

[data-theme="dark"] {
    --primary-glow: rgba(194, 71, 110, .12);
}

.store-page {
    background: var(--bg);
    min-height: 100vh;
}

/* ════════════════════════
   TOP BAR
════════════════════════ */
.store-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--hdr-bg, rgba(250, 250, 250, 0.96));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line-2, #e8e8ed);
    transition: box-shadow .3s, background .4s;
}

.store-topbar.scrolled {
    box-shadow: 0 1px 20px rgba(0, 0, 0, .08);
}

.store-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.store-topbar-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.store-topbar-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
    margin-left: auto;
}

.store-back {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--ink-2, #6e6e73);
    text-decoration: none;
    padding: .3rem .6rem;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.store-back:hover {
    color: var(--ink);
    background: var(--bg-2);
}

.store-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.store-logo {
    height: 26px;
    width: auto;
    display: block;
}

.store-brand-sep {
    color: var(--line, #d1d1d6);
    font-size: 1.1rem;
    font-weight: 200;
}

.store-brand-label {
    font-size: .82rem;
    font-weight: 500;
    color: var(--ink-2);
}

.store-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--bg-2, #f5f5f7);
    border: 1px solid var(--line-2, #e8e8ed);
    border-radius: 8px;
    padding: .52rem .85rem;
    transition: border-color .2s;
}

.store-search-wrap:focus-within {
    border-color: var(--primary);
}

.store-search-wrap svg {
    stroke: var(--ink-3, #a1a1a6);
    flex-shrink: 0;
}

.store-search-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: .85rem;
    color: var(--ink);
    outline: none;
}

.store-search-wrap input::placeholder {
    color: var(--ink-3);
}

.store-cart-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line-2);
    background: var(--bg-card, #fff);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.store-cart-btn:hover {
    border-color: var(--primary);
    transform: scale(1.06);
}

.store-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--primary, #3d0022);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: opacity .25s, transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.store-cart-count.visible {
    opacity: 1;
    transform: scale(1);
}

/* ════════════════════════
   HERO
════════════════════════ */
.store-hero {
    position: relative;
    color: white;
    padding: 4rem 2rem 3.5rem;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
}

.store-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 70% at 20% 50%, rgba(194, 71, 110, .3) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 85% 30%, rgba(30, 0, 15, .6) 0%, transparent 60%),
        linear-gradient(135deg, #3d0022 0%, #1a000d 100%);
}

.store-hero-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black, transparent);
}

.store-hero-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.store-hero-eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #ff7baa;
    margin-bottom: 1rem;
    opacity: .9;
}

.store-hero h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.03em;
    color: white;
    margin: 0 0 .85rem;
    animation: fadeUp .7s ease both;
}

.store-hero h1 em {
    font-style: normal;
    background: linear-gradient(120deg, #ffb3cd, #ff7baa, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.store-hero p {
    font-size: .96rem;
    color: rgba(255, 255, 255, .65);
    margin: 0 0 1.5rem;
    max-width: 520px;
    animation: fadeUp .7s .15s ease both;
}

.store-hero-badges {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    animation: fadeUp .7s .28s ease both;
}

.store-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .15);
    color: rgba(255, 255, 255, .85);
    font-size: .76rem;
    font-weight: 500;
    padding: .3rem .8rem;
    border-radius: 99px;
}

.store-hero-badge svg {
    stroke: #ff7baa;
}

/* ════════════════════════
   LAYOUT
════════════════════════ */
.store-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
}

/* ════════════════════════
   SIDEBAR
════════════════════════ */
.store-sidebar {
    position: sticky;
    top: 74px;
    height: fit-content;
}

.store-sidebar-section {
    margin-bottom: 1.75rem;
}

.store-sidebar-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--ink-3);
    margin-bottom: .75rem;
}

.store-cat-list {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.store-cat-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .52rem .7rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--ink-2);
    font-size: .84rem;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-align: left;
    width: 100%;
}

.store-cat-btn:hover {
    background: var(--bg-2);
    color: var(--ink);
}

.store-cat-btn.active {
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 600;
}

.store-cat-btn svg {
    flex-shrink: 0;
    stroke: currentColor;
}

.store-cat-count {
    margin-left: auto;
    font-size: .71rem;
    font-weight: 600;
    color: var(--ink-3);
    background: var(--bg-2);
    border-radius: 99px;
    padding: .1rem .5rem;
    min-width: 22px;
    text-align: center;
}

.store-cat-btn.active .store-cat-count {
    background: var(--primary-glow);
    color: var(--primary);
}

.store-checkbox {
    display: flex;
    align-items: center;
    gap: .65rem;
    cursor: pointer;
    font-size: .84rem;
    color: var(--ink-2);
    user-select: none;
}

.store-checkbox input {
    display: none;
}

.store-checkbox-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--line, #d1d1d6);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}

.store-checkbox input:checked+.store-checkbox-box {
    background: var(--primary);
    border-color: var(--primary);
}

.store-checkbox input:checked+.store-checkbox-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.store-price-inputs {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.store-price-inputs input {
    flex: 1;
    padding: .45rem .6rem;
    border: 1.5px solid var(--line-2);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--ink);
    font-size: .82rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
    width: 0;
}

.store-price-inputs input:focus {
    border-color: var(--primary);
}

.store-price-inputs span {
    color: var(--ink-3);
    font-size: .84rem;
    flex-shrink: 0;
}

.store-select {
    width: 100%;
    padding: .5rem .75rem;
    border: 1.5px solid var(--line-2);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--ink);
    font-size: .84rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
}

.store-select:focus {
    border-color: var(--primary);
}

/* ════════════════════════
   MAIN HEADER
════════════════════════ */
.store-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.store-main-header-left h2 {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.02em;
    margin: 0;
}

.store-result-count {
    font-size: .8rem;
    color: var(--ink-3);
    margin-top: .15rem;
    display: block;
}

.store-view-toggle {
    display: flex;
    gap: .25rem;
}

.store-view-btn {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid var(--line-2);
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.store-view-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ════════════════════════
   PRODUCTS GRID
════════════════════════ */
.store-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.store-products-grid.list-view {
    grid-template-columns: 1fr;
}

.store-product-card {
    background: var(--bg-card);
    border: 1px solid var(--line-2);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: border-color .3s, box-shadow .3s, transform .4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: fadeUpSm .4s ease both;
}

.store-product-card:hover {
    border-color: var(--line, #d1d1d6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .1);
    transform: translateY(-4px);
}

.store-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #c2476e);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s cubic-bezier(0.22, 1, 0.36, 1);
}

.store-product-card:hover::before {
    transform: scaleX(1);
}

.store-product-visual {
    height: 180px;
    background: var(--bg-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
    overflow: hidden;
    transition: background .3s;
}

.store-product-card:hover .store-product-visual {
    background: var(--bg-2);
}

/* Imagen real del producto en tarjeta */
.store-visual-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .5s cubic-bezier(0.22, 1, 0.36, 1), filter .3s;
    filter: brightness(.98) saturate(.95);
}

.store-product-card:hover .store-visual-img {
    transform: scale(1.05);
    filter: brightness(1.03) saturate(1.05);
}

/* Imagen en modal */
.store-visual-img--modal {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    display: block;
    transition: transform .45s cubic-bezier(0.22, 1, 0.36, 1);
}

.store-modal-visual:hover .store-visual-img--modal {
    transform: scale(1.04);
}

/* Emoji de fallback cuando la imagen falla */
.store-visual-emoji {
    font-size: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.store-product-badge {
    position: absolute;
    top: .75rem;
    left: .75rem;
    font-size: .63rem;
    font-weight: 700;
    padding: .18rem .5rem;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.store-product-badge.new {
    background: var(--primary);
    color: white;
}

.store-product-badge.low {
    background: #fff3e0;
    color: #e65100;
}

.store-product-badge.out {
    background: #ffebee;
    color: #c62828;
}

.store-product-body {
    padding: 1rem 1.2rem 1.2rem;
}

.store-product-cat {
    font-size: .67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--primary);
    margin-bottom: .3rem;
}

.store-product-name {
    font-size: .94rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .3rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-product-sku {
    font-size: .71rem;
    color: var(--ink-3);
    margin-bottom: .6rem;
}

.store-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
}

.store-product-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.02em;
}

.store-product-stock {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .73rem;
}

.store-stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.store-stock-dot.in {
    background: #22c55e;
}

.store-stock-dot.low {
    background: #f97316;
}

.store-stock-dot.out {
    background: #ef4444;
}

.store-product-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .2s, background .2s;
}

.store-product-add-btn:hover {
    transform: scale(1.14);
    background: #5a0033;
}

.store-product-add-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none;
}

/* List view */
.store-products-grid.list-view .store-product-card {
    display: grid;
    grid-template-columns: 110px 1fr;
}

.store-products-grid.list-view .store-product-visual {
    height: 100%;
    border-radius: 0;
}

.store-products-grid.list-view .store-product-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ════════════════════════
   STATES: LOADING / EMPTY / ERROR
════════════════════════ */
.store-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 5rem 2rem;
    color: var(--ink-2);
    font-size: .84rem;
}

.store-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--line-2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.store-empty,
.store-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 5rem 2rem;
    color: var(--ink-2);
    text-align: center;
}

.store-empty svg,
.store-error svg {
    stroke: var(--ink-3);
}

.store-empty h3,
.store-error h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}

.store-empty p,
.store-error p {
    font-size: .84rem;
    max-width: 300px;
    color: var(--ink-2);
    margin: 0;
}

.store-btn-retry {
    margin-top: .25rem;
    padding: .55rem 1.4rem;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}

.store-btn-retry:hover {
    opacity: .85;
}

/* ════════════════════════
   PRODUCT MODAL
════════════════════════ */
.store-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.store-modal-overlay.hidden {
    display: none;
}

.store-modal {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
    animation: modalIn .32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.95) translateY(20px)
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0)
    }
}

.store-modal-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--bg-2);
    color: var(--ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background .15s, transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.store-modal-close:hover {
    background: var(--line);
    transform: rotate(90deg) scale(1.1);
}

.store-modal-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 340px;
}

.store-modal-visual {
    background: var(--bg-2);
    border-radius: 18px 0 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    min-height: 340px;
    transition: background .3s;
    /* Contiene la imagen sin que desborde */
    overflow: hidden;
    position: relative;
}

.store-modal-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.store-modal-badges {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.store-modal-badge {
    font-size: .65rem;
    font-weight: 700;
    padding: .18rem .55rem;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.store-modal-badge.cat {
    background: var(--primary-glow);
    color: var(--primary);
}

.store-modal-info h2 {
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.02em;
    margin: 0;
}

.store-modal-desc {
    font-size: .87rem;
    color: var(--ink-2);
    line-height: 1.7;
    margin: 0;
}

.store-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.store-modal-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: .81rem;
    padding: .28rem 0;
    border-bottom: 1px solid var(--line-2);
    color: var(--ink-2);
}

.store-modal-meta-row:last-child {
    border-bottom: none;
}

.store-modal-meta-row strong {
    color: var(--ink);
    font-weight: 600;
}

.store-modal-price-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.store-modal-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.03em;
}

.store-modal-stock {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 500;
}

.store-modal-qty {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--line-2);
    border-radius: 9px;
    overflow: hidden;
    width: fit-content;
}

.store-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .15s;
}

.store-qty-btn:hover {
    background: var(--bg-2);
}

.store-qty-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.store-modal-qty span {
    min-width: 38px;
    text-align: center;
    font-size: .96rem;
    font-weight: 600;
    color: var(--ink);
}

.store-modal-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.store-modal-add-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
}

.store-modal-add-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}

.store-modal-compat {
    font-size: .77rem;
    color: var(--ink-3);
    line-height: 1.6;
    padding: .6rem .85rem;
    background: var(--bg-2);
    border-radius: 8px;
}

/* ════════════════════════
   CART DRAWER
════════════════════════ */
.store-cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(6px);
}

.store-cart-overlay.hidden {
    display: none;
}

.store-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    z-index: 450;
    background: var(--bg-card);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 60px rgba(0, 0, 0, .13);
    animation: drawerIn .3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.store-cart-drawer.hidden {
    display: none;
}

@keyframes drawerIn {
    from {
        transform: translateX(100%);
        opacity: 0
    }

    to {
        transform: translateX(0);
        opacity: 1
    }
}

.store-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line-2);
    flex-shrink: 0;
}

.store-cart-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.store-cart-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--bg-2);
    color: var(--ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
}

.store-cart-close:hover {
    background: var(--line);
}

.store-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: .75rem;
}

.store-cart-items::-webkit-scrollbar {
    width: 4px;
}

.store-cart-items::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border-radius: 4px;
}

.store-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 3rem 1rem;
    color: var(--ink-3);
    font-size: .84rem;
    text-align: center;
}

.store-cart-empty svg {
    stroke: var(--ink-3);
    opacity: .4;
}

.store-cart-empty p {
    font-weight: 600;
    color: var(--ink-2);
    margin: 0;
}

.store-cart-empty span {
    font-size: .78rem;
}

.store-cart-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem;
    border-radius: 10px;
    border: 1px solid var(--line-2);
    margin-bottom: .45rem;
    background: var(--bg-card);
    transition: border-color .2s;
}

.store-cart-item-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-cart-item-img {
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 10px;
    flex-shrink: 0;
    transition: transform .3s;
}

.store-cart-item:hover .store-cart-item-img {
    transform: scale(1.08);
}

.store-cart-item-emoji {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-cart-item-info {
    flex: 1;
    min-width: 0;
}

.store-cart-item-name {
    font-size: .83rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-cart-item-price {
    font-size: .76rem;
    color: var(--ink-2);
    margin-top: .1rem;
}

.store-cart-item-controls {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.store-cart-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--ink);
    font-size: .85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.store-cart-qty-btn:hover {
    background: var(--line-2);
}

.store-cart-item-qty {
    font-size: .84rem;
    font-weight: 600;
    color: var(--ink);
    min-width: 18px;
    text-align: center;
}

.store-cart-item-remove {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: #ffebee;
    color: #c62828;
    font-size: .8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: .15rem;
    transition: background .15s;
}

.store-cart-item-remove:hover {
    background: #ffcdd2;
}

.store-cart-footer {
    padding: 1.2rem 1.5rem;
    border-top: 1px solid var(--line-2);
    flex-shrink: 0;
}

.store-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .95rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .85rem;
}

.store-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .82rem;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.store-checkout-btn:hover {
    opacity: .87;
    transform: translateY(-1px);
}

.store-cart-note {
    font-size: .71rem;
    color: var(--ink-3);
    margin-top: .65rem;
    line-height: 1.5;
}

/* ════════════════════════
   CHECKOUT MODAL
════════════════════════ */
.store-checkout-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.store-checkout-overlay.hidden {
    display: none;
}

.store-checkout-modal {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 22px;
    max-width: 920px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .25);
    animation: modalIn .35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.store-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
}

.store-checkout-left {
    padding: 2rem;
    border-right: 1px solid var(--line-2);
}

.store-checkout-right {
    padding: 2rem;
    background: var(--bg-2);
    border-radius: 0 20px 20px 0;
}

.store-checkout-section-title {
    font-size: .69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--ink-3);
    margin-bottom: 1rem;
}

/* Payment rows */
.store-payment-methods {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
    border: 1.5px solid var(--line-2);
    border-radius: 12px;
    overflow: hidden;
}

.store-payment-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1.1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--line-2);
    background: var(--bg-card);
    transition: background .15s;
}

.store-payment-row:last-of-type {
    border-bottom: none;
}

.store-payment-row:hover {
    background: var(--bg-2);
}

.store-payment-row.active {
    background: var(--primary-glow);
}

.store-payment-label {
    flex: 1;
    font-size: .87rem;
    font-weight: 500;
    color: var(--ink);
}

.store-payment-icons {
    display: flex;
    gap: .35rem;
}

.store-pay-icon {
    padding: .14rem .5rem;
    border-radius: 4px;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .04em;
    border: 1px solid var(--line-2);
    background: var(--bg-card);
}

.store-pay-icon.visa {
    color: #1a1f71;
}

.store-pay-icon.mc {
    color: #eb001b;
}

.store-pay-icon.amex {
    color: #007bc1;
}

.store-pay-icon.bank,
.store-pay-icon.cash {
    font-size: 1rem;
    border: none;
    background: none;
    padding: 0;
}

.store-payment-chevron {
    stroke: var(--ink-3);
    transition: transform .3s;
    flex-shrink: 0;
}

.store-payment-row.active .store-payment-chevron {
    transform: rotate(180deg);
}

.store-payment-form-wrap {
    display: none;
    padding: 1rem 1.1rem 1.1rem;
    border-bottom: 1px solid var(--line-2);
    background: var(--bg-2);
    animation: fadeUp .28s ease both;
}

.store-payment-form-wrap.active {
    display: block;
}

.store-payment-form-wrap:last-child {
    border-bottom: none;
}

.store-pay-field {
    display: flex;
    flex-direction: column;
    gap: .28rem;
    margin-bottom: .75rem;
}

.store-pay-field:last-child {
    margin-bottom: 0;
}

.store-pay-field label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--ink);
}

.store-pay-field input {
    padding: .56rem .8rem;
    border: 1.5px solid var(--line-2);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--ink);
    font-size: .86rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.store-pay-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.store-pay-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: .75rem;
}

.store-pay-info-box {
    background: var(--bg-card);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    padding: .85rem 1rem;
    font-size: .82rem;
    color: var(--ink-2);
    line-height: 1.7;
}

.store-pay-info-box strong {
    color: var(--ink);
    display: block;
    margin-bottom: .35rem;
    font-size: .84rem;
}

.store-pay-info-box p {
    margin: 0;
}

.store-field-error {
    font-size: .73rem;
    color: #e5484d;
    min-height: .9rem;
}

.store-confirm-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    margin-top: 1.5rem;
    padding: .82rem;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .25s;
}

.store-confirm-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
}

.store-confirm-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.store-secure-note {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .71rem;
    color: var(--ink-3);
    margin-top: .75rem;
    justify-content: center;
}

.store-secure-note svg {
    stroke: var(--ink-3);
    flex-shrink: 0;
}

/* Order summary */
.store-order-summary h4 {
    font-size: .88rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 1rem;
}

.store-order-lines {
    margin-bottom: .75rem;
}

.store-order-line {
    display: flex;
    justify-content: space-between;
    padding: .38rem 0;
    font-size: .81rem;
    color: var(--ink-2);
    border-bottom: 1px solid var(--line-2);
}

.store-order-line:last-child {
    border-bottom: none;
}

.store-order-line-name {
    flex: 1;
    padding-right: .5rem;
}

.store-order-divider {
    height: 1px;
    background: var(--line, #d1d1d6);
    margin: .75rem 0;
}

.store-order-row {
    display: flex;
    justify-content: space-between;
    font-size: .83rem;
    color: var(--ink-2);
    padding: .22rem 0;
}

.store-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    padding: .5rem 0;
}

.store-order-total span:last-child {
    color: var(--primary);
}

.store-order-note {
    font-size: .72rem;
    color: var(--ink-3);
    margin-top: .85rem;
    line-height: 1.5;
    border-top: 1px solid var(--line-2);
    padding-top: .75rem;
}

/* ════════════════════════
   PAYMENT ERROR TOAST
════════════════════════ */
.store-payment-error {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    max-width: 390px;
    background: var(--bg-card);
    border: 1.5px solid #fca5a5;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(239, 68, 68, .2);
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1.1rem 1.25rem;
    animation: errorSlideIn .4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.store-payment-error.hidden {
    display: none;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.96)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

.store-error-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.store-error-icon svg {
    stroke: #dc2626;
}

.store-error-content {
    flex: 1;
}

.store-error-content strong {
    display: block;
    font-size: .9rem;
    color: var(--ink);
    margin-bottom: .25rem;
}

.store-error-content p {
    font-size: .81rem;
    color: var(--ink-2);
    line-height: 1.55;
    margin: 0;
}

.store-error-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--bg-2);
    color: var(--ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}

.store-error-close:hover {
    background: var(--line);
}

/* ════════════════════════
   LIGHTBOX
════════════════════════ */
.store-lightbox {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, .92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: lbIn .25s ease both;
    cursor: zoom-out;
}

.store-lightbox.hidden {
    display: none;
}

@keyframes lbIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.store-lightbox-inner {
    position: relative;
    max-width: min(90vw, 1000px);
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    animation: lbImgIn .3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lbImgIn {
    from {
        opacity: 0;
        transform: scale(.88) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.store-lightbox-img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .6);
    display: block;
    user-select: none;
}

.store-lightbox-close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .12);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: background .2s, transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.store-lightbox-close:hover {
    background: rgba(255, 255, 255, .22);
    transform: rotate(90deg) scale(1.1);
}

.store-lightbox-hint {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .74rem;
    color: rgba(255, 255, 255, .4);
    letter-spacing: .04em;
    pointer-events: none;
    white-space: nowrap;
}

.store-lightbox-hint kbd {
    font-family: inherit;
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
    padding: .1rem .35rem;
    font-size: .7rem;
}

/* Cursor lupa en la imagen del modal para indicar que es clicable */
.store-modal-visual {
    cursor: zoom-in;
}

/* ════════════════════════
   UTILITIES
════════════════════════ */
.hidden {
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(32px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes fadeUpSm {
    from {
        opacity: 0;
        transform: translateY(14px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ════════════════════════
   RESPONSIVE
════════════════════════ */
@media (max-width: 1024px) {
    .store-layout {
        grid-template-columns: 190px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .store-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .store-sidebar {
        position: static;
    }

    .store-cat-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .1rem;
    }

    .store-products-grid {
        grid-template-columns: 1fr 1fr;
    }

    .store-cart-drawer {
        width: 100%;
    }

    .store-checkout-layout {
        grid-template-columns: 1fr;
    }

    .store-checkout-right {
        border-radius: 0 0 20px 20px;
    }

    .store-modal-body {
        grid-template-columns: 1fr;
    }

    .store-modal-visual {
        border-radius: 18px 18px 0 0;
        min-height: 220px;
        height: 220px;
        overflow: hidden;
        position: relative;
    }
}

@media (max-width: 520px) {
    .store-products-grid {
        grid-template-columns: 1fr;
    }

    .store-topbar-inner {
        padding: 0 1rem;
        gap: .75rem;
    }

    .store-brand-label {
        display: none;
    }

    .store-search-wrap {
        display: none;
    }

    .store-checkout-left,
    .store-checkout-right {
        padding: 1.25rem;
    }
}