@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-text-main: #1f2937;
    --color-text-muted: #6b7280;
    --color-bg-main: #ffffff;
    --color-bg-muted: #f9fafb;
    --color-bg-alt: #f3f4f6;
    --color-border: #e5e7eb;
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    --font-inter: "Inter", sans-serif;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-inter);
    color: var(--color-text-main);
    background-color: var(--color-bg-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

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

input,
select,
textarea {
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    width: 100%;
    outline: none;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

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

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Typography */
.title-xl {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.title-lg {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.title-md {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
}

.text-highlight {
    color: var(--color-primary);
    font-style: italic;
}

/* Buttons */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.btn-dark {
    background-color: var(--color-text-main);
    color: white;
}

.btn-dark:hover {
    background-color: #000;
}

.btn-text {
    color: var(--color-primary);
    font-weight: 700;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Header & Nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-link {
    color: var(--color-text-muted);
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link.active {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.cart-toggle {
    position: relative;
    padding: 0.5rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.cart-toggle:hover {
    background: #e5e7eb;
}

.cart-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    height: 16px;
    width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

/* Hero Section */
.hero-section {
    padding: 4rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Grids */
.section-padding {
    padding: 4rem 0;
}

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

/* Card components (Categories/Products via JS) */
.card {
    background: var(--color-bg-main);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

/* Login & Admin */
.login-box {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--color-bg-main);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
}

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

.error-msg {
    color: var(--color-danger);
    font-size: 0.875rem;
    text-align: center;
    margin-top: 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.admin-panel {
    background: var(--color-bg-muted);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.admin-panel:hover {
    box-shadow: var(--shadow-md);
}

.admin-panel h3 {
    color: var(--color-primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.admin-list {
    margin-top: 1.5rem;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Sidebar Cart */
.cart-sidebar-container {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    justify-content: flex-end;
}

.cart-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.cart-sidebar {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--color-bg-main);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    animation: slideIn 0.3s forwards;
}

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

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

.cart-close:hover {
    color: var(--color-text-main);
}

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

.cart-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 2rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-main);
}

/* Modals */
.modal-container {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--color-bg-main);
    width: 100%;
    max-width: 500px;
    margin: 1rem;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 71;
}

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

.modal-close {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text-muted);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--color-text-main);
}

.modal-body {
    overflow-y: auto;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--color-text-main);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 100;
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification.show {
    transform: translateY(0);
}

/* Animations */
.page-fade {
    animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        transform: translateX(0);
    }
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-muted);
    padding: 3rem 0;
    text-align: center;
    margin-top: 5rem;
}

.footer-copy {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.footer-link {
    color: #d1d5db;
    font-size: 0.75rem;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--color-primary);
}