:root {
    --bg-color: #0f172a;
    /* Default, will be overridden by JS */
    --text-color: #f8fafc;
    --primary: #8b5cf6;
    /* Default, will be overridden by JS */
    --primary-glow: rgba(139, 92, 246, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 41, 59, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

/* Background Animation */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.globe-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--primary);
    animation: float 20s infinite alternate;
}

.globe-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: #3b82f6;
    /* Could also be dynamic, but blue is nice contrast */
    animation: float 25s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Header */
.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cart-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    font-size: 0.75rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Filters */
.filters {
    margin: 2rem 0;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: #94a3b8;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
    border-color: var(--primary);
}

/* Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(5px);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.product-media {
    position: relative;
    padding-top: 100%;
    /* Square Aspect Ratio for better consistency */
    background: #000;
    overflow: hidden;
}

.product-media iframe,
.product-media img,
.product-media div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    pointer-events: none;
    /* Pass clicks to card */
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: 0;
    line-height: 1.3;
    font-weight: 600;
    flex: 1;
}

.video-btn {
    width: auto;
    margin: 0;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.5), 0 2px 4px -1px rgba(220, 38, 38, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    align-self: flex-start;
    animation: btn-pulse 2s infinite;
}

@keyframes btn-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

.video-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.5), 0 4px 6px -2px rgba(220, 38, 38, 0.3);
    animation: none;
    /* Stop pulsing on hover */
}

.product-media {
    position: relative;
    cursor: pointer;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 60px;
    height: 60px;
    background: rgba(220, 38, 38, 0.85);
    /* Red background */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    border: 3px solid rgba(255, 255, 255, 0.8);
    opacity: 0.9;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 5;
    pointer-events: none;
    /* Let click pass to card or handle separately */
}

.product-card:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: #dc2626;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.6);
}

.add-btn {
    width: 100%;
    background: white;
    color: black;
    /* Force black text for contrast */
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
}

.add-btn:hover {
    background: #cbd5e1;
}

/* Product Detail Modal */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    padding: 2rem;
}

.product-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1e293b;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
}

.modal-gallery {
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
    overflow: hidden;
}

.modal-media-item {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.modal-media-item.active {
    display: block;
}

.zoom-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-container.zoomed img {
    transform: scale(2);
    cursor: zoom-out;
}

.zoom-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.5rem;
    z-index: 10;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.modal-dots {
    position: absolute;
    bottom: 15px;
    display: flex;
    gap: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.dot.active {
    background: white;
}

.modal-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-close {
    align-self: flex-end;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2.5rem;
    /* Larger icon */
    padding: 0.5rem;
    /* Larger touch area */
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #ff5555;
}

.back-btn {
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    /* Glass effect */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-price {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.modal-desc {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Cart Modal Existing Styles ... */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    /* Higher than product modal */
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.cart-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.cart-content {
    width: 100%;
    max-width: 400px;
    background: #1e293b;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
}

.cart-modal.visible .cart-content {
    transform: translateX(0);
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem;
    border-radius: 8px;
    align-items: center;
}

.item-details {
    flex: 1;
}

.item-title {
    font-weight: 600;
    display: block;
}

.item-meta {
    font-size: 0.8rem;
    color: #94a3b8;
}

.remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.2rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    background: #22c55e;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.checkout-btn:hover {
    background: #16a34a;
}