:root {
    /* Core Colors */
    --color-brand: #000000;
    --color-brand-hover: #333333;
    --color-accent: #2563eb;

    /* Backgrounds */
    --bg-body: #ffffff;
    --bg-subtle: #f9fafb;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.4);

    /* Text Colors */
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --text-inverse: #ffffff;

    /* Status Colors */
    --color-success: #10b981;
    --color-success-bg: #d1fae5;
    --color-warning: #f59e0b;
    --color-warning-bg: #fef3c7;
    --color-error: #ef4444;
    --color-error-bg: #fee2e2;
    --color-info: #3b82f6;
    --color-info-bg: #dbeafe;

    /* Borders */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-focus: #000000;

    /* Layout Dimensions */
    --container-width: 1200px;
    --header-height: 70px;
    --admin-sidebar-w: 260px;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-float: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Z-Indices */
    --z-negative: -1;
    --z-normal: 1;
    --z-sticky: 100;
    --z-drawer: 800;
    --z-modal-backdrop: 900;
    --z-modal: 1000;
    --z-toast: 2000;
}

/* --------------------------------------------------------------------------
   RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

button {
    font-family: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   UTILITY CLASSES
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.block { display: block; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.m-0 { margin: 0; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; line-height: 1; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }
.capitalize { text-transform: capitalize; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.text-brand { color: var(--color-brand); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-inverse); }
.text-error { color: var(--color-error); }
.text-success { color: var(--color-success); }
.bg-white { background-color: var(--bg-card); }
.bg-subtle { background-color: var(--bg-subtle); }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-modal { z-index: var(--z-modal); }

.border { border: 1px solid var(--border-light); }
.border-t { border-top: 1px solid var(--border-light); }
.border-b { border-bottom: 1px solid var(--border-light); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

/* --------------------------------------------------------------------------
   UI COMPONENTS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background-color: var(--color-brand);
    color: var(--text-inverse);
    border: 1px solid transparent;
}
.btn-primary:hover {
    background-color: var(--color-brand-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}
.btn-secondary:hover {
    border-color: var(--text-muted);
    background-color: var(--bg-subtle);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--color-brand);
}
.btn-outline:hover {
    background: var(--color-brand);
    color: var(--text-inverse);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
}
.btn-ghost:hover {
    color: var(--color-brand);
    background-color: rgba(0,0,0,0.05);
}

.btn-full { width: 100%; }

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

.label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.input, .textarea, .select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-main);
    background-color: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px var(--border-focus);
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.card-body { padding: 1.5rem; }
.card-header { 
    padding: 1.5rem; 
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-footer {
    padding: 1rem 1.5rem;
    background-color: var(--bg-subtle);
    border-top: 1px solid var(--border-light);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    line-height: 1;
}
.badge-success { background: var(--color-success-bg); color: #065f46; }
.badge-warning { background: var(--color-warning-bg); color: #92400e; }
.badge-error { background: var(--color-error-bg); color: #991b1b; }
.badge-info { background: var(--color-info-bg); color: #1e40af; }
.badge-neutral { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border-light); }

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid currentColor;
    width: 1.5rem;
    height: 1.5rem;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   STOREFRONT STYLES
   -------------------------------------------------------------------------- */
.header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}
.header.scrolled {
    border-bottom-color: var(--border-light);
}

.nav-link {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-main);
    position: relative;
    padding: 0.5rem 0;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--color-brand);
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

.cart-count-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--color-brand);
    color: white;
    font-size: 0.7rem;
    height: 1.125rem;
    width: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
}

.hero-wrapper {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: stretch;
}
.hero-media {
    flex: 1.5;
    background: var(--bg-subtle);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hero-details {
    flex: 1;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-card);
}

.main-img-container {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    background: white;
    box-shadow: var(--shadow-sm);
}
.main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumb-list {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.thumb-item {
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    opacity: 0.7;
    transition: all 0.2s;
    background: white;
}
.thumb-item.active {
    border-color: var(--color-brand);
    opacity: 1;
}
.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.variant-group {
    display: flex;
    gap: 0.75rem;
}
.variant-option {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.variant-option:hover { border-color: var(--border-medium); }
.variant-option.selected {
    border-color: var(--color-brand);
    background: var(--color-brand);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}
.review-item {
    padding: 2rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
}

/* --------------------------------------------------------------------------
   ADMIN PANEL STYLES
   -------------------------------------------------------------------------- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-subtle);
}

.admin-sidebar {
    width: var(--admin-sidebar-w);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-light);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-light);
    font-weight: 800;
    font-size: 1.25rem;
}
.sidebar-nav {
    padding: 1.5rem 1rem;
    flex: 1;
    overflow-y: auto;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}
.sidebar-link:hover {
    background-color: var(--bg-subtle);
    color: var(--text-main);
}
.sidebar-link.active {
    background-color: #eff6ff;
    color: var(--color-accent);
}
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.admin-content {
    margin-left: var(--admin-sidebar-w);
    flex: 1;
    padding: 2rem;
    width: calc(100% - var(--admin-sidebar-w));
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}
.table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}
.table th {
    text-align: left;
    padding: 1rem 1.5rem;
    background-color: var(--bg-subtle);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
}
.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9375rem;
    color: var(--text-main);
}
.table tr:hover td { background-color: #fafafa; }

/* --------------------------------------------------------------------------
   INTERACTIVE MODULES
   -------------------------------------------------------------------------- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(2px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 450px;
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
.drawer-panel.open { transform: translateX(0); }

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.drawer-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-subtle);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }

.modal-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-backdrop.open .modal-card { transform: scale(1) translateY(0); }

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 320px;
    animation: slideInRight 0.3s ease forwards;
}
.toast-success { border-left: 4px solid var(--color-success); }
.toast-error { border-left: 4px solid var(--color-error); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1024px) {
    :root { --container-width: 90%; }
    .hero-details { padding: 2rem; }
}

@media (max-width: 768px) {
    .text-5xl { font-size: 2.25rem; }
    .hero-wrapper { flex-direction: column; min-height: auto; }
    .hero-media { padding: 0; aspect-ratio: 1/1; }
    .hero-details { padding: 2rem 1.5rem; }
    .main-img-container { border-radius: 0; max-width: 100%; margin-bottom: 0; box-shadow: none; }
    .nav-desktop { display: none; }
    .admin-sidebar { 
        transform: translateX(-100%); 
        transition: transform 0.3s ease;
        width: 80%;
        box-shadow: var(--shadow-xl);
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-content { margin-left: 0; width: 100%; padding: 1rem; }
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
    .container { padding-left: 1rem; padding-right: 1rem; }
}