/* Base Reset and Variables */
:root {
    --primary-color: #0f172a;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --text-main: #334155;
    --text-light: #64748b;
    --bg-main: #ffffff;
    --bg-secondary: #f8fafc;
    --border-color: #e2e8f0;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.py-xl {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--accent-hover);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 40;
    background-color: var(--bg-main);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.025em;
}

.nav-links {
    display: none;
    gap: 2rem;
    font-weight: 500;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-links a:hover {
    color: var(--accent-color);
}

.cart-icon {
    position: relative;
    font-size: 1.25rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -5px;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    height: 18px;
    min-width: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Hero Section */
.hero {
    background-color: var(--bg-secondary);
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Products Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-img-wrapper {
    display: block;
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background-color: var(--bg-secondary);
    overflow: hidden;
}

.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.product-price {
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.add-to-cart-btn {
    margin-top: auto;
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Cart Drawer */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--bg-main);
    z-index: 60;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.cart-drawer.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.close-cart {
    font-size: 1.25rem;
    color: var(--text-light);
}

.close-cart:hover {
    color: var(--primary-color);
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-item-price {
    color: var(--text-light);
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cart-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.cart-item-remove {
    margin-left: auto;
    color: #ef4444;
    font-size: 0.9rem;
}

.empty-cart-msg {
    text-align: center;
    color: var(--text-light);
    margin-top: 2rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.checkout-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.checkout-btn:hover {
    background-color: #1e293b;
}

/* WhatsApp Widget */
.whatsapp-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    transition: var(--transition);
}

.whatsapp-widget:hover {
    transform: scale(1.1);
    background-color: #128C7E;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* --- Product Detail Pages --- */
.product-details-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 900px) {
    .product-details-container {
        grid-template-columns: 1fr 1fr;
    }
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    aspect-ratio: 1;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    cursor: pointer;
    object-fit: cover;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: var(--transition);
}

.thumbnail.active, .thumbnail:hover {
    opacity: 1;
    border-color: var(--primary-color);
}

.product-info-detailed {
    display: flex;
    flex-direction: column;
}

.product-title-large {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.rating {
    color: #fbbf24;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating span {
    color: var(--text-light);
    margin-left: 0.5rem;
}

.product-price-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.product-description-short {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.add-to-cart-btn-large {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.product-tabs {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.tab-headers {
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding-bottom: 1rem;
    font-weight: 600;
    color: var(--text-light);
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
    color: var(--text-main);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

.tab-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

.tab-content li {
    margin-bottom: 0.5rem;
}

.review-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.review-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.review-item span {
    color: #fbbf24;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}
/* Dark Mode Theme */
body.dark-mode {
    --primary-color: #f8fafc;
    --accent-color: #60a5fa;
    --accent-hover: #93c5fd;
    --text-main: #f1f5f9;
    --text-light: #cbd5e1;
    --bg-main: #0f172a;
    --bg-secondary: #1e293b;
    --border-color: #334155;
    --card-bg: #1e293b;
}

body {
    transition: background-color 0.3s, color 0.3s;
}

.product-card {
    background: var(--bg-secondary);
}

.cart-drawer, .drawer {
    position: fixed;
    top: 0;
    width: 400px;
    height: 100vh;
    background-color: var(--bg-main);
    z-index: 100;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.drawer.right {
    right: 0;
}

.drawer.active {
    transform: translateX(0);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.drawer-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.drawer-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background-color: var(--primary-color);
    color: var(--bg-main);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    opacity: 0;
    transition: 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.header-actions {
    display: flex;
    gap: 1.5rem;
}

.icon-link {
    position: relative;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-main);
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters {
    display: flex;
    gap: 1rem;
}

.search-input, .category-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    color: var(--text-main);
}

.wishlist-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-secondary);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.product-img-wrapper {
    position: relative;
    display: block;
}

