:root {
    --bg-dark: #050000;
    --bg-card: rgba(15, 10, 10, 0.85);
    --primary-red: #ff0000;
    --primary-red-glow: rgba(255, 0, 0, 0.5);
    --neon-border: 1px solid var(--primary-red);
    --neon-shadow: 0 0 15px var(--primary-red-glow), inset 0 0 15px rgba(255, 0, 0, 0.15);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --ps-color: #0070d1;
    --xbox-color: #107C10;
}

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(200, 0, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(200, 0, 0, 0.1) 0%, transparent 40%);
}

/* Background Effects */
.background-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M1 1h2v2H1V1z" fill="rgba(255,0,0,0.03)"/></svg>');
    opacity: 0.5;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header Styles */
.profile-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: fadeInDown 0.8s ease;
}

.profile-img-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 0.5rem;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 25px;
    border: 2px solid var(--primary-red);
    box-shadow: 0 0 25px var(--primary-red-glow);
}

.verified-badge {
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    background-color: var(--bg-dark);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    font-size: 1.2rem;
    box-shadow: 0 0 10px var(--primary-red-glow);
}

.store-name {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-shadow: 0 0 10px var(--primary-red-glow);
}

.en-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-red);
    letter-spacing: 2px;
}

.store-bio {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--bg-card);
    border: var(--neon-border);
    box-shadow: var(--neon-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px) scale(1.05);
    background: var(--primary-red);
    color: white;
    box-shadow: 0 0 25px var(--primary-red);
}

/* Controls (Search & Filter) */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.search-sort-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 1.2rem 1.2rem 1.2rem 3rem;
    border-radius: 15px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border: var(--neon-border);
    box-shadow: var(--neon-shadow);
}

.search-box i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-red);
}

.sort-box select {
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: 15px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ff0000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem top 50%;
    background-size: 0.65rem auto;
}

.sort-box select:focus {
    border: var(--neon-border);
    box-shadow: var(--neon-shadow);
}


.category-filters {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.category-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 0, 0, 0.2);
    color: var(--text-main);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-red);
}

.filter-btn.active {
    background: rgba(255, 0, 0, 0.15);
    color: white;
    border: var(--neon-border);
    box-shadow: var(--neon-shadow);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.5rem;
    border: var(--neon-border);
    box-shadow: var(--neon-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.4s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px var(--primary-red), inset 0 0 15px rgba(255, 0, 0, 0.2);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: -35px;
    background: var(--primary-red);
    color: white;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 5px 40px;
    transform: rotate(-45deg);
    box-shadow: 0 2px 15px var(--primary-red-glow);
    text-transform: uppercase;
}

.product-badge.discount { background: #e60000; }
.product-badge.pre-order { background: #ff9900; }

.product-image-container {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 0, 0, 0.2);
    position: relative;
    background: #000;
}

.product-image-blur {
    position: absolute;
    top: -10%; left: -10%; right: -10%; bottom: -10%;
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.4);
    z-index: 0;
}

.product-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    transition: transform 0.5s ease;
}

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

.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
}

.product-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.product-pricing {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: rgba(0,0,0,0.5);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255,0,0,0.1);
}

.price-tier {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-tier:not(:last-child) {
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed rgba(255,0,0,0.2);
}

.duration {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.price-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.old-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.new-price {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary-red);
    text-shadow: 0 0 10px var(--primary-red-glow);
}

.buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: var(--primary-red);
    color: white;
    text-decoration: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    border: none;
    box-shadow: 0 0 15px var(--primary-red-glow);
}

.buy-btn:hover {
    background: #cc0000;
    box-shadow: 0 0 20px var(--primary-red);
    transform: scale(1.02);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,0,0,0.2);
    animation: fadeInUp 0.8s ease 0.6s both;
}

footer p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.credit {
    font-size: 0.85rem !important;
    color: var(--primary-red) !important;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.hidden {
    display: none !important;
}


/* Sticky Header */
.sticky-header {
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    background-color: rgba(200, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sticky-header.visible {
    top: 0;
}

.sticky-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sticky-logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sticky-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.sticky-store-name {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.sticky-category {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .sticky-content {
        padding: 0.6rem 1rem;
    }
    
    .sticky-store-name {
        font-size: 1rem;
    }
    
    .sticky-logo {
        width: 35px;
        height: 35px;
    }
    
    .sticky-category {
        font-size: 0.85rem;
        padding: 0.3rem 0.8rem;
    }
}

.logo-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

#mainLogo {
    position: absolute;
    top: 40px; /* match container padding-top roughly */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#mainLogo.scrolled {
    position: fixed;
    width: 40px;
    height: 40px;
    margin: 0;
}

#mainLogo.scrolled .profile-img {
    border-width: 2px;
}

#mainLogo.scrolled .verified-badge {
    transform: scale(0.6);
    bottom: -5px;
    right: -5px;
}

#stickyLogoTarget {
    width: 40px;
    height: 40px;
}


/* Sub Filters */
.sub-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: center;
}
.sub-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.sub-filter-label {
    color: #a0a0a0;
    font-size: 0.95rem;
    font-weight: 600;
    margin-left: 0.5rem;
}
.sub-filter-btn {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.3s ease;
}
.sub-filter-btn.active, .sub-filter-btn:hover {
    background-color: #107C10;
    border-color: #107C10;
}

/* PlayStation sub-filter buttons use PS blue */
#playstationSubFilters .sub-filter-btn.active,
#playstationSubFilters .sub-filter-btn:hover {
    background-color: #0070d1;
    border-color: #0070d1;
}

/* Layout Toggle Button */
.layout-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    width: 50px;
    height: 50px;
    border-radius: 15px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: var(--primary-red);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.layout-toggle-btn:hover {
    border: var(--neon-border);
    box-shadow: var(--neon-shadow);
}

/* Grid Layouts controlled by JS */
.products-grid.grid-1 {
    grid-template-columns: 1fr;
}
.products-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.products-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Responsive grid: force single column on small screens */
@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: 1fr !important;
    }
    .products-grid.grid-2,
    .products-grid.grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
