/* CSS Variables */
:root {
    --primary: 220 85% 57%;
    --primary-hover: 220 85% 47%;
    --background: 0 0% 100%;
    --foreground: 222 47% 11%;
    --card: 0 0% 98%;
    --card-border: 214 32% 91%;
    --muted: 210 40% 96%;
    --muted-foreground: 215 16% 47%;
    --accent: 210 40% 96%;
    --accent-foreground: 222 47% 11%;
    --border: 214 32% 91%;
    --input-border: 214 32% 91%;
    --ring: 220 85% 57%;
    --radius: 0.5rem;
}

.dark {
    --primary: 217 91% 60%;
    --primary-hover: 217 91% 70%;
    --background: 224 71% 4%;
    --foreground: 213 31% 91%;
    --card: 224 71% 7%;
    --card-border: 216 34% 17%;
    --muted: 223 47% 11%;
    --muted-foreground: 215 20% 65%;
    --accent: 216 34% 17%;
    --accent-foreground: 213 31% 91%;
    --border: 216 34% 17%;
    --input-border: 216 34% 17%;
    --ring: 217 91% 60%;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: hsl(var(--background) / 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid hsl(var(--border));
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo svg {
    color: hsl(var(--primary));
}

.logo:hover {
    opacity: 0.8;
}

.nav {
    display: none;
    gap: 0.25rem;
}

@media (min-width: 768px) {
    .nav {
        display: flex;
    }
}

.nav a {
    padding: 0.5rem 1rem;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav a:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle, .cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    color: hsl(var(--foreground));
    transition: all 0.2s;
}

.theme-toggle:hover, .cart-button:hover {
    background: hsl(var(--accent));
}

.sun-icon, .moon-icon {
    position: absolute;
    transition: opacity 0.2s, transform 0.2s;
}

.dark .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

.dark .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(180deg);
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.cart-button {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: hsl(var(--primary));
    border-radius: 9999px;
}

/* Hero Section */
.hero {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary) / 0.6) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: hsl(var(--primary));
    color: white;
}

.btn-primary:hover {
    background: hsl(var(--primary-hover));
}

.btn-secondary {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-secondary:hover {
    background: hsl(var(--muted));
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Products Section */
.products-section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

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

.product-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--card-border));
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

.product-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-image-link {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: hsl(var(--muted));
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-info {
    padding: 1.25rem;
}

.product-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: hsl(var(--primary));
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.product-name:hover {
    color: hsl(var(--primary));
}

.product-description {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

/* Product Detail Page */
.product-detail {
    padding: 2rem 0;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .product-detail-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.product-detail-image {
    width: 100%;
    aspect-ratio: 1;
    background: hsl(var(--muted));
    border-radius: var(--radius);
    overflow: hidden;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-info h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-detail-info .product-category {
    margin-bottom: 1rem;
}

.product-detail-info .product-price {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.product-detail-info .product-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.product-features {
    margin-bottom: 1.5rem;
}

.product-features h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.product-features ul {
    list-style: none;
    padding: 0;
}

.product-features li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: hsl(var(--muted-foreground));
}

.product-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: hsl(var(--primary));
    font-weight: 700;
}

/* Policy Pages */
.policy-page {
    padding: 3rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.policy-page h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.policy-page h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
}

.policy-page p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: hsl(var(--muted-foreground));
}

.policy-page ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.policy-page ul li {
    margin-bottom: 0.5rem;
    color: hsl(var(--muted-foreground));
}

/* Contact Page */
.contact-page {
    padding: 3rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

.contact-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.contact-info p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: hsl(var(--muted-foreground));
}

.contact-form {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--card-border));
    border-radius: var(--radius);
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid hsl(var(--input-border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: none;
}

.cart-drawer.open {
    display: block;
}

.cart-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.cart-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background: hsl(var(--background));
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

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

.cart-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.cart-close {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: transparent;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    transition: color 0.2s;
}

.cart-close:hover {
    color: hsl(var(--foreground));
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.empty-cart {
    text-align: center;
    color: hsl(var(--muted-foreground));
    padding: 2rem 0;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--card-border));
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    background: hsl(var(--muted));
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: hsl(var(--accent));
}

.quantity {
    min-width: 2rem;
    text-align: center;
    font-weight: 600;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid hsl(var(--border));
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cart-footer .btn {
    margin-bottom: 0.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: hsl(var(--foreground));
    color: hsl(var(--background));
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 200;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Footer */
.footer {
    background: hsl(var(--card));
    border-top: 1px solid hsl(var(--border));
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p {
    color: hsl(var(--muted-foreground));
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: hsl(var(--primary));
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
}
