/* Shop Page Styles */

/* Shop Hero Section */
.shop-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, #0a0e1a 0%, #060a14 60%, #000000 100%);
    margin-top: 80px;
}

/* Scanlines overlay - sits behind the text (z-index 1, below content at z-index 2) */
.shop-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.18) 3px,
        rgba(0, 0, 0, 0.18) 4px
    );
    animation: scanlinesDrift 8s linear infinite;
}

@keyframes scanlinesDrift {
    0% { background-position: 0 0; }
    100% { background-position: 0 80px; }
}

/* ASCII Fire Background Container for Shop */
#shop-ascii-fire {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    isolation: isolate;
    filter: blur(1.5px);
}

#shop-ascii-fire .ascii-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    isolation: isolate;
}


#shop-ascii-fire .ascii-world {
    position: absolute;
    inset: 0;
    z-index: 1;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    pointer-events: none;
    overflow: visible;
}

#shop-ascii-fire .pattern-copy {
    position: absolute;
    inset: 0;
    transform: translate3d(var(--offset-x), var(--offset-y), 0);
    backface-visibility: hidden;
    pointer-events: none;
}

#shop-ascii-fire .ascii {
    margin: 0;
    white-space: pre;
    font-family: monospace;
    font-size: clamp(9px, 1.2vw, 14px);
    font-weight: 400;
    line-height: 0.84;
    letter-spacing: 0;
    text-align: left;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: auto;
}

#shop-ascii-fire .ascii-measure {
    position: absolute;
    top: -9999px;
    left: -9999px;
    visibility: hidden;
    pointer-events: none;
}

#shop-ascii-fire .ascii-tile {
    position: absolute;
    width: max-content;
    height: max-content;
    transform: translate3d(var(--x), var(--y), 0);
    pointer-events: none;
    opacity: 0.18;
    backface-visibility: hidden;
}

#shop-ascii-fire .ascii-tile.glitching {
    animation: tileGlitch 0.12s ease-out forwards;
}

@keyframes tileGlitch {
    0%   { transform: translate3d(calc(var(--x) + var(--glitch-x)), var(--y), 0); opacity: 0.12; }
    50%  { transform: translate3d(calc(var(--x) - calc(var(--glitch-x) * 0.4)), var(--y), 0); opacity: 0.10; }
    100% { transform: translate3d(var(--x), var(--y), 0); opacity: 0.12; }
}

#shop-ascii-fire .layer {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    white-space: pre;
    pointer-events: none;
    backface-visibility: hidden;
}

#shop-ascii-fire .base {
    position: relative;
    z-index: 3;
    color: rgb(80 160 255 / var(--base-opacity, 1));
    text-shadow:
        0 0 2px rgb(0 102 255 / 0.5),
        0 0 6px rgb(0 150 255 / 0.3);
    transition: color 420ms linear, text-shadow 420ms linear;
}

#shop-ascii-fire .glow {
    opacity: var(--glow-opacity, 0.75);
    filter: blur(var(--glow-blur, 0.06px));
    text-shadow:
        0 0 2px rgb(var(--glow-core-rgb, 255 255 255) / var(--glow-white-a, 0.85)),
        0 0 5px rgb(var(--glow-hot-rgb, 232 249 255) / var(--glow-ice-a, 0.75)),
        0 0 10px rgb(var(--glow-mid-rgb, 150 232 255) / var(--glow-blue-a, 0.55)),
        0 0 16px rgb(var(--glow-outer-rgb, 72 185 255) / var(--glow-outer-a, 0.35)),
        0 0 24px rgb(var(--glow-deep-rgb, 24 94 255) / var(--glow-deep-a, 0.18));
    transition: opacity var(--flicker-ms, 160ms) linear, filter var(--flicker-ms, 160ms) linear, text-shadow var(--flicker-ms, 160ms) linear;
}

#shop-ascii-fire .ghost {
    opacity: var(--ghost-opacity, 0.15);
    filter: blur(var(--ghost-blur, 0.15px));
    text-shadow:
        0 0 6px rgb(var(--ghost-rgb-1, 136 224 255) / var(--ghost-a1, 0.15)),
        0 0 12px rgb(var(--ghost-rgb-2, 70 184 255) / var(--ghost-a2, 0.10)),
        0 0 20px rgb(var(--ghost-rgb-3, 24 94 255) / var(--ghost-a3, 0.06));
    transition: opacity var(--flicker-ms, 160ms) linear, filter var(--flicker-ms, 160ms) linear, text-shadow var(--flicker-ms, 160ms) linear;
}


.shop-hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
    animation: shopHeroFadeIn 1.5s ease-out;
}

.shop-hero-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.shop-hero-title h1 {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(2.8rem, 6.5vw, 5rem);
    font-weight: 900;
    color: #eaf2ff;
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 1;
    text-shadow:
        0 0 15px rgba(200, 225, 255, 0.55),
        0 0 40px rgba(100, 160, 255, 0.4),
        0 0 80px rgba(50, 100, 220, 0.22),
        2px 2px 0px rgba(0, 0, 0, 0.9);
}

.shop-hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    font-weight: 300;
    color: rgba(220, 235, 255, 0.85);
    letter-spacing: 0.35em;
    margin-bottom: 2.2rem;
    text-shadow: none;
}

/* Red divider line under subtitle */
.shop-hero-content::after {
    content: '';
    display: block;
    margin: 0 auto;
    width: 180px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #cc1111 20%, #ff2222 50%, #cc1111 80%, transparent 100%);
    box-shadow:
        0 0 6px rgba(255, 40, 40, 0.8),
        0 0 18px rgba(200, 20, 20, 0.6),
        0 0 35px rgba(180, 0, 0, 0.4);
    border-radius: 2px;
}


@keyframes shopTitleGlow {
    0% {
        text-shadow: 
            0 0 20px #0066ff,
            3px 3px 0px rgba(0, 0, 0, 0.8);
    }
    100% {
        text-shadow: 
            0 0 30px #0066ff,
            0 0 40px #0066ff,
            3px 3px 0px rgba(0, 0, 0, 0.8);
    }
}

@keyframes shopHeroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shop Filters */
.shop-filters {
    padding: 0.75rem 0;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 80px;
    z-index: 100;
}

.filter-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-group label {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    font-size: 0.8rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    transition: all 0.3s ease;
    min-width: 130px;
    appearance: auto;
}

.filter-select:focus {
    outline: none;
    border-color: rgba(0, 102, 255, 0.4);
    box-shadow: 0 0 6px rgba(0, 102, 255, 0.15);
}

.filter-select option {
    background: #000000;
    color: #ffffff;
}

.view-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 1rem;
}

.view-toggle:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
}

.view-toggle.active {
    color: rgba(0, 102, 255, 0.8);
    background: rgba(0, 102, 255, 0.08);
}

/* Shop Section */
.shop-section {
    padding: 3rem 0;
    background: #111111;
    min-height: 60vh;
}

.shop-loading {
    text-align: center;
    padding: 4rem 0;
    color: #ffffff;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 102, 255, 0.3);
    border-radius: 50%;
    border-top-color: #0066ff;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.shop-grid.loaded {
    opacity: 1;
}

.shop-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.shop-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    max-width: none;
}

.shop-grid.list-view .product-image {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.shop-grid.list-view .product-info {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.shop-empty {
    text-align: center;
    padding: 4rem 0;
    color: #cccccc;
}

.empty-icon {
    font-size: 4rem;
    color: #0066ff;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.shop-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

/* Enhanced Product Cards */
.product-card {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    backdrop-filter: blur(10px);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 102, 255, 0.05), rgba(0, 170, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 102, 255, 0.3),
        0 0 60px rgba(0, 170, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 102, 255, 0.5);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 300px;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-info {
    padding: 1.5rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.product-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-family: 'Bebas Neue', cursive;
    letter-spacing: 1px;
}

.product-price {
    font-size: 1.2rem;
    color: #0066ff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 102, 255, 0.5);
    margin-bottom: 0.5rem;
}

.product-description {
    font-size: 0.9rem;
    color: #cccccc;
    line-height: 1.4;
    margin-top: 0.5rem;
}

/* Newsletter Section */
.newsletter-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    border-top: 1px solid rgba(0, 102, 255, 0.3);
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 0 20px #0066ff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.newsletter-subtitle {
    font-size: 1.1rem;
    color: #cccccc;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem;
    border: 1px solid rgba(0, 102, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.3);
}

.newsletter-form input::placeholder {
    color: #888888;
}

/* Shopping Cart */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 102, 255, 0.3);
    z-index: 10000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(0, 102, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    color: #ffffff;
    font-family: 'Bebas Neue', cursive;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.cart-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cart-close:hover {
    color: #0066ff;
}

.cart-items {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.cart-item:hover {
    background: rgba(0, 102, 255, 0.1);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    color: #ffffff;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: #0066ff;
    font-weight: 600;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    background: rgba(0, 102, 255, 0.2);
    border: 1px solid #0066ff;
    color: #ffffff;
    width: 25px;
    height: 25px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #0066ff;
}

.cart-footer {
    padding: 2rem;
    border-top: 1px solid rgba(0, 102, 255, 0.3);
}

.cart-total {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.cart-checkout {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #0066ff, #00aaff);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.floating-cart:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.5);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.cart-count.visible {
    transform: scale(1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .shop-hero {
        margin-top: 56px;
        min-height: 45vh;
        padding: 2rem 1.5rem;
    }

    .shop-hero-content {
        padding: 0 1rem;
        width: 100%;
    }

    .shop-hero-title h1 {
        font-size: clamp(1.8rem, 8vw, 3rem);
        letter-spacing: 2px;
        word-break: break-word;
        hyphens: auto;
    }
    
    .shop-hero-title {
        flex-direction: column;
        gap: 0.5rem;
    }

    .shop-hero-subtitle {
        font-size: clamp(0.75rem, 3.5vw, 1rem);
        letter-spacing: 0.2em;
        padding: 0 0.5rem;
    }

    /* Filters: stack vertically on mobile for full text visibility */
    .shop-filters {
        padding: 0.75rem 0;
        top: 56px;
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        padding: 0 1rem;
    }

    .filter-group {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
    }

    .filter-group label {
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 70px;
    }

    .filter-select {
        flex: 1;
        min-width: 0;
        padding: 0.45rem 0.6rem;
        font-size: 0.85rem;
    }

    /* View toggles: put them in their own row, right-aligned */
    .filter-group:last-child {
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .view-toggle {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        padding: 0.4rem;
    }
    
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .shop-grid.list-view .product-card {
        flex-direction: column;
    }
    
    .shop-grid.list-view .product-image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .shop-hero {
        min-height: 35vh;
        padding: 1.5rem 1rem;
    }

    .shop-hero-title h1 {
        font-size: clamp(1.5rem, 9vw, 2.2rem);
        letter-spacing: 1px;
    }

    .shop-hero-subtitle {
        font-size: clamp(0.65rem, 3vw, 0.85rem);
        letter-spacing: 0.15em;
    }
    
    .shop-grid {
        grid-template-columns: 1fr;
    }
    
    .floating-cart {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}
