:root {
    --bg-color: #0a0a0a;
    --primary-accent: #0078D4; 
    --tile-bg: #1a1a1a;
    --text-main: #FFFFFF;
    --text-secondary: #A0A0A0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    padding: 12px;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Slideshow */
#bg-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: var(--bg-color);
}

.bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    filter: brightness(0.25) grayscale(0.3);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Base container for animations */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 1;
    opacity: 0; 
    transform: translateY(20px);
}

/* Ensure container inside sticky footer is always visible and reset */
.sticky-footer .container {
    opacity: 1 !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 20px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0 25px;
    width: 100%;
}

.main-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-icon-wrapper {
    position: relative;
    font-size: 1.6rem;
    flex-shrink: 0;
}

#cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--primary-accent);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 2px solid var(--bg-color);
}

/* Grid & Tiles */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.tile {
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: var(--tile-bg);
}

.profile-tile {
    grid-column: span 2;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.profile-tile img {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.social-links-profile-tile {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.product-tile {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Featured / Pinned Tile Styling */
.product-tile.featured-tile {
    border: 2px solid #FFB900;
    box-shadow: 0 0 20px rgba(255, 185, 0, 0.3);
    position: relative;
}

.product-tile.featured-tile::before {
    content: "FEATURED";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FFB900;
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.product-tile img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-tile-content {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-tile-content h3 {
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #fff;
}

.price-tag {
    display: inline-block;
    background: rgba(0, 0, 0, 0.5);
    color: #FFFFFF;
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.strike-price {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.8); 
    font-size: 0.65rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: inline-block;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.sold-count {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    background: rgba(0, 0, 0, 0.2);
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(5px);
}

/* Fix overlapping on small screens (360px and below) */
@media (max-width: 380px) {
    .product-tile-content h3 {
        font-size: 0.85rem;
        margin-bottom: 8px;
        font-weight: 700;
    }
    .price-tag {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    .strike-price {
        font-size: 0.7rem;
    }
    .product-tile-content div[style*="align-items: flex-end"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .sold-count {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
}

/* Homepage Filter Styling */
.filter-container {
    display: flex;
    gap: 8px;
    margin-bottom: 25px; /* Fixed margin */
    overflow-x: auto;
    padding: 5px 0 15px; /* Added top/bottom padding */
    scrollbar-width: none; 
    -webkit-overflow-scrolling: touch;
    width: 100%;
    position: relative;
}
.filter-container::-webkit-scrollbar { display: none; } 

/* Mask fade for scroll indication */
.filter-wrapper {
    position: relative;
    margin-bottom: 10px;
}
.filter-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 40px;
    background: linear-gradient(to right, transparent, var(--bg-color));
    pointer-events: none;
    z-index: 5;
}

.filter-pill {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: #A0A0A0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.filter-pill.active {
    background: var(--primary-accent);
    color: #fff;
    border-color: var(--primary-accent);
    box-shadow: 0 0 15px rgba(0, 120, 212, 0.4);
}

/* Custom Checkbox Glass-morphism */
.custom-checkbox {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block !important;
    vertical-align: middle;
    outline: none !important;
    margin-right: 10px;
}
.custom-checkbox:checked {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: #0078D4 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}
.custom-checkbox:checked::after {
    content: "";
    position: absolute;
    top: 45%;
    left: 50%;
    width: 5px;
    height: 10px;
    border: solid #3b82f6;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.8));
}
.custom-checkbox:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.agreement {
    display: flex;
    align-items: center; /* Vertical centering */
    gap: 5px;
    font-size: 0.85rem;
    color: #A0A0A0;
    cursor: pointer;
    line-height: 1.4;
}

/* Navigation System */
.desktop-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    align-items: center;
    padding: 0 40px;
}

.desktop-nav .nav-container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 600;
    color: #A0A0A0;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
}

.mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s;
}

.mobile-bottom-bar a i {
    font-size: 1.5rem;
}

.mobile-bottom-bar a.active {
    color: #fff !important;
}

.mobile-bottom-bar a.active i {
    color: var(--primary-accent) !important;
    filter: drop-shadow(0 0 10px rgba(0, 120, 212, 0.8)) !important;
    opacity: 1 !important;
}

/* Onboarding Tooltip */
.onboarding-tooltip {
    position: fixed;
    background: var(--primary-accent);
    color: #fff;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 5000;
    box-shadow: 0 10px 30px rgba(0, 120, 212, 0.4);
    max-width: 250px;
    pointer-events: auto; /* Changed to auto */
}

.onboarding-tooltip::after {
    content: '';
    position: absolute;
    border: 8px solid transparent;
}

.onboarding-tooltip.bottom::after {
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: var(--primary-accent);
}

@media (min-width: 769px) {
    .desktop-nav { display: flex; }
    .mobile-bottom-bar { display: none; }
    body { padding-top: 100px !important; }
    .container { margin-top: 0 !important; } 
}

@media (max-width: 768px) {
    .container { padding-bottom: 90px; } /* Space for bottom nav */
}

/* Responsive */
@media (min-width: 600px) {
    body { padding: 30px; }
    .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
    .profile-tile img { width: 110px; height: 110px; }
    .main-header h2 { font-size: 1.8rem; }
}

@media (min-width: 900px) {
    .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Utils */
.product-description ul, .product-description ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.product-description p {
    margin-bottom: 10px;
}

.glass-plate {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 35px 25px; /* Increased padding */
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.product-detail-content h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    line-height: 1.2;
    color: #fff;
}

.product-detail-content .price {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 25px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Premium Product Page Styling */
.product-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.product-page-price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
}

.product-page-price {
    font-size: 2.2rem;
    font-weight: 900;
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.product-page-strike {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.4);
    text-decoration: line-through;
    font-weight: 600;
}

.product-page-sold {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.1);
}

.product-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    font-size: 1.05rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
}

/* Global button reset */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #0078D4 !important;
    color: #FFFFFF !important;
    padding: 16px;
    font-size: 1rem;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 120, 212, 0.3);
    position: relative;
    z-index: 5;
    opacity: 1 !important;
}

@media (max-width: 599px) {
    .btn {
        padding: 12px 10px;
        font-size: 0.85rem;
        gap: 6px;
    }
}

.btn:hover {
    background: #008cff !important;
    transform: translateY(-2px);
}

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

.btn-loading {
    pointer-events: none;
    opacity: 0.8 !important;
}

.btn-loading i {
    animation: btn-spin 1s linear infinite;
}

@keyframes btn-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Swiper */
.swiper { width: 100%; height: 400px; border-radius: 16px; margin-bottom: 20px; border: 1px solid rgba(255,255,255,0.1); }
.swiper-slide img { width: 100%; height: 100%; object-fit: contain; }
.swiper-slide iframe { width: 100%; height: 100%; border: none; }

/* Cart */
/* Payment Method Grid */
.payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.payment-method {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.payment-method i {
    font-size: 1.5rem;
    color: var(--text-dim);
}

.payment-method span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
}

.payment-method:hover {
    background: rgba(255, 255, 255, 0.1);
}

.payment-method.active {
    background: rgba(0, 120, 212, 0.1);
    border-color: var(--primary-accent);
}

.payment-method.active i, .payment-method.active span {
    color: var(--primary-accent);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.remove-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #FFFFFF;
}

.cart-summary span:last-child {
    color: #10b981;
}

.cart-page-wrapper {
    padding-bottom: 180px; 
}

.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0 calc(15px + env(safe-area-inset-bottom)); /* Support Notch */
    z-index: 900; 
    box-shadow: 0 -15px 40px rgba(0,0,0,0.6);
}

/* Adjust for pages with both sticky footer and mobile nav */
@media (max-width: 768px) {
    .sticky-footer {
        bottom: 75px; /* Increased from 70px to be safe */
        padding: 15px 0;
        border-radius: 24px 24px 0 0;
        height: auto !important;
        min-height: 80px;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.8);
    }
    .cart-page-wrapper {
        padding-bottom: 280px !important;
    }
    .product-page-padding {
        padding-bottom: 280px !important;
    }
    .btn {
        height: 54px; /* Slightly taller for better touch target */
        font-size: 0.85rem;
    }
}

@media (max-width: 380px) {
    .sticky-footer .container {
        padding: 0 15px !important;
        gap: 8px !important;
    }
    .btn {
        padding: 10px 8px !important;
        font-size: 0.75rem !important;
        height: 45px;
    }
}
