:root {
    --bg-color: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #0f172a;
    --primary-hover: #334155;
    --accent: #10b981;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: clip;
}

.background-mesh {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    background-image: 
        radial-gradient(at 40% 20%, hsla(28,100%,74%,1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189,100%,56%,1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(355,100%,93%,1) 0px, transparent 50%);
    opacity: 0.15;
    filter: blur(40px);
}

/* Header */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span { color: var(--accent); }

.search-bar input {
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    width: 300px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.2s;
}
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1); }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 { font-size: 3.5rem; font-weight: 700; letter-spacing: -1px; margin-bottom: 1rem; }
.hero p { font-size: 1.25rem; color: var(--text-muted); }

/* Grid */
/* Category Filter */
.category-filter {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0 2rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
}
.category-filter::-webkit-scrollbar {
    display: none;
}
.category-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid rgba(0,0,0,0.05);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.category-btn:hover {
    background: #e2e8f0;
}
.category-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.image-carousel {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    background: #f1f5f9;
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    height: 100%;
}
.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.carousel-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background: rgba(0,0,0,0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 99px;
    backdrop-filter: blur(4px);
}

.dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: 0.2s;
}
.dot.active { background: white; transform: scale(1.2); }

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    flex-grow: 1;
}

.btn-buy {
    width: 100%;
    padding: 1rem;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-buy:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Skeleton */
.skeleton {
    height: 400px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modal */
/* Modal Core */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

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

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#productModal .modal-content {
    width: 100%;
    max-width: none;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: none;
    background: transparent;
    transform: scale(0.95);
    opacity: 0;
}

#productModal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

#cartModal {
    justify-content: flex-end;
}

#cartModal .modal-content {
    width: 400px;
    max-width: 90%;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: none;
    margin: 0;
    transform: translateX(100%);
}

#cartModal.active .modal-content {
    transform: translateX(0);
}

.modal-overlay.active .modal-content:not(#productModal .modal-content):not(#cartModal .modal-content) {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--accent);
    color: white;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-icon {
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.cart-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.cart-icon span {
    background: var(--accent);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-left: 0.5rem;
}

/* Variant Modal */
.variant-content {
    max-width: 700px;
    padding: 2.5rem;
}

.variant-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.variant-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.variant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.variant-item {
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.variant-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.variant-item.selected {
    border-color: var(--accent);
}

.variant-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Cart Modal */
.cart-content {
    max-width: 600px;
    padding: 2.5rem;
}

.cart-content h2 {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.cart-items {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 2rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-item img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

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

.cart-item-title {
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.cart-item-price {
    color: var(--text-secondary);
}

.remove-item {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-item:hover {
    background: rgba(255, 85, 85, 0.1);
    color: #ff5555;
    border-color: #ff5555;
}

.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.cart-total {
    font-size: 1.5rem;
    font-weight: bold;
}

.checkout-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.cart-notes {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cart-notes label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}
.cart-notes textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #f8fafc;
    font-family: 'Outfit', sans-serif;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: all 0.2s;
}
.cart-notes textarea:focus {
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .header-actions { gap: 1rem; }
    .cart-icon { padding: 0.4rem 0.8rem; }
    .cart-footer { flex-direction: column; gap: 1rem; text-align: center; }
    .checkout-btn { width: 100%; }
}
.modal-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.modal-gallery {
    flex: 1.5;
    background: transparent;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s;
    z-index: 5;
}
.modal-nav-btn:hover { background: white; }
.modal-nav-btn.prev { left: 1rem; }
.modal-nav-btn.next { right: 1rem; }

.modal-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background: rgba(0,0,0,0.3);
    padding: 0.5rem 0.75rem;
    border-radius: 99px;
    backdrop-filter: blur(4px);
    z-index: 5;
}
.modal-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: 0.2s;
}
.modal-dot.active { background: white; transform: scale(1.2); }

.modal-carousel-item {
    width: 100%;
    height: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 12px;
}
.modal-details {
    flex: 1;
    padding: 2rem;
    background: var(--surface);
    overflow: hidden;
    max-height: 100vh;
}
.modal-details h2 { margin-bottom: 1rem; color: var(--primary); font-size: 2rem; }
.modal-details p { white-space: pre-wrap; color: var(--text-muted); line-height: 1.6; margin-bottom: 2rem; font-size: 1.1rem; }

@media (min-width: 768px) {
    .modal-body { flex-direction: row; }
}
@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 1rem; }
    .search-bar input { width: 100%; }
    .hero h1 { font-size: 2.5rem; }
}

/* Floating Chat Button */
.floating-chat {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.floating-chat:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}
.floating-chat img {
    width: 35px;
    height: 35px;
}

/* Language Toggle */
.lang-toggle {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    margin-right: 1rem;
}

/* Extra Cart Inputs */
.cart-extra-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--glass-border);
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.input-group input[type="text"] {
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #f8fafc;
    font-family: inherit;
    outline: none;
}
.input-group input[type="text"]:focus {
    border-color: var(--accent);
}

/* Watermark Styles */
.watermark-container {
    position: relative;
}
.watermark-container::after {
    content: 'YOUR BRAND';
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 10;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 2px;
}

/* Smaller watermark for variant grid */
.variant-item.watermark-container::after {
    bottom: 50%;
    right: 50%;
    transform: translate(50%, 50%);
    font-size: 1rem;
}

/* Larger watermark for full screen modal */
.modal-gallery.watermark-container::after {
    font-size: 2rem;
    bottom: 3rem;
    right: 3rem;
}
