/*  GLOBAL STYLES  */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/*  THEME VARIABLES  */
:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --header-gradient: linear-gradient(135deg, #0066cc 0%, #0047a3 50%, #002d5f 100%);
    --header-text: white;
    --nav-bg: linear-gradient(90deg, #ffffff 0%, #f8fbff 100%);
    --nav-border: #0066cc;
    --accent-color: #0066cc;
    --rating-color: #f4b400;
}

body[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #dddddd;
    --border-color: #333333;
    --header-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d1a1a 50%, #3d0000 100%);
    --header-text: #ff4444;
    --nav-bg: linear-gradient(90deg, #1a1a1a 0%, #1f0f0f 100%);
    --nav-border: #cc0000;
    --accent-color: #ff4444;
    color-scheme: dark;
    --rating-color: #ffd369;
}

/*  HEADER  */
header {
    position: sticky;
    top: 0;
    background: var(--header-gradient);
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.25);
    padding: 1rem 0;
    z-index: 100;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--header-text);
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0;
    flex: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.logo-text {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--header-text);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg);
}

.theme-toggle:focus {
    outline: 2px solid var(--accent-color);
    border-radius: 6px;
}

/* Demo toggle in header */
.demo-toggle {
    margin-left: 0.5rem;
    background: none;
    border: 1px solid rgba(0,0,0,0.06);
    color: var(--demo-text, #d97706);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.demo-toggle[aria-pressed="true"] {
    background: linear-gradient(90deg, rgba(0,0,0,0.03), rgba(0,0,0,0.02));
}

/* Admin indicator badge */
.admin-indicator {
    display: none;
    margin-left: 0.5rem;
    background: #059669;
    color: #fff;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
body[data-demo-admin="true"] .admin-indicator { display: inline-block; }

/* Admin-only controls hidden when not in demo admin */
body[data-demo-admin="false"] .admin-only { display: none !important; }

/*  NAVIGATION  */
.navbar {
    position: sticky;
    top: 72px;
    background: var(--nav-bg);
    border-bottom: 2px solid var(--nav-border);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.12);
    z-index: 99;
}

.nav-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: flex-start;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 0;
    align-items: center;
}

/* when open on mobile, show vertical menu */
.nav-links.open {
    display: flex;
}

.nav-link {
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.nav-link.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.cart-icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
}

.cart-icon-btn:hover {
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/*  MODALS  */
.modal, .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.modal {
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    background-color: transparent;
    z-index: 999;
}

.modal-overlay.active {
    display: block;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--border-color);
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

/* Trust bar under hero */
.trust-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.trust-bar > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*  ACCESSIBILITY  */
:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: transparent;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.close-modal-btn:hover {
    color: var(--text-primary);
}

/*  FORMS */
.add-item-form {
    max-width: 600px;
}

.add-item-form h2,
.contact-form h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    margin-top: 0;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group small {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.submit-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    background-color: #0052a3;
}

.submit-btn:active {
    transform: scale(0.98);
}

/*  CART SIDEBAR  */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: var(--bg-secondary);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    border-left: 1px solid var(--border-color);
}

.cart-sidebar.open {
    right: 0;
}

@media (max-width: 768px) {
    .cart-sidebar {
        width: 85vw;
        right: -85vw;
    }
}

@media (max-width: 480px) {
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--accent-color) 0%, #0052a3 100%);
    color: white;
}

.cart-header h2 {
    font-size: 1.3rem;
    margin: 0;
    color: white;
}

.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.empty-cart {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 2rem;
    font-size: 1rem;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    background-color: var(--border-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    font-weight: 600;
    min-width: 32px;
    min-height: 32px;
}

.quantity-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

.remove-item-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
    min-width: 32px;
    min-height: 32px;
}

.remove-item-btn:hover {
    background-color: #cc0000;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-align: right;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-color) 0%, #0052a3 100%);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.checkout-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/*  MAIN CONTENT */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-container {
    flex: 1;
    padding: 2rem;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/*  HERO SECTION */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #0052a3 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-btn {
    display: inline-block;
    background-color: white;
    color: var(--accent-color);
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/*  FEATURES SECTION */
.features-section {
    margin: 3rem 0;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.features-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-8px);
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* CAROUSEL */
.carousel-container {
    margin: 3rem 0;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.carousel-container h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    overflow-x: auto;
}

.carousel-slide {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    will-change: transform;
}

.carousel-slide:hover {
    transform: translateY(-8px);
}

.carousel-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--border-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.carousel-slide img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.carousel-info {
    padding: 1rem;
}

.carousel-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.carousel-price {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.carousel-btn {
    width: 100%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    opacity: 0.9;
}

/* PRODUCTS PAGE */
.products-container {
    max-width: 1280px;
    margin: 0 auto;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.products-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
}

.add-item-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.add-item-btn:hover {
    background-color: #0052a3;
}

.search-filter-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input,
.category-filter {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-input:focus,
.category-filter:focus {
    outline: none;
    border-color: var(--accent-color);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.no-items {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    padding: 3rem 0;
    grid-column: 1 / -1;
}

.item-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
    will-change: transform;
}

/*  SKELETON LOADERS */
.skeleton-card {
    pointer-events: none;
}
.skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.06) 50%, rgba(0,0,0,0.03) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
}
.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.06) 50%, rgba(0,0,0,0.03) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
    border-radius: 6px;
    margin: 12px 0;
}
.skeleton-line.title { width: 70%; height: 18px; }
.skeleton-line.short { width: 40%; }
.skeleton-line.long { width: 90%; }
.skeleton-line.price { width: 30%; height: 16px; margin-top: 18px; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.item-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--bg-primary);
    position: relative;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Ensure placeholder text has sufficient contrast and follows theme */
input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

.item-card:hover img {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--border-color) 100%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
}

.item-card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background-color: #cc0000;
    transform: scale(1.1);
}

/* Edit button (admin) */
.edit-btn {
    position: absolute;
    top: 10px;
    right: 60px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.2s ease;
}

.item-card:hover .edit-btn { opacity: 1; }

.edit-btn:hover { transform: scale(1.05); background-color: #0047a3; }

/* Trust signals */
.trust-signals {
    display:flex;
    gap:1rem;
    align-items:center;
    justify-content:center;
    margin:1.25rem 0;
    padding:0.5rem 1rem;
    background: linear-gradient(90deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
    border-radius:8px;
    font-size:0.95rem;
    color:var(--text-primary);
}
.trust-item { display:flex; align-items:center; gap:0.5rem; }

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--rating-color);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}
.rating .stars {
    letter-spacing: 0.5px;
}
.review-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.carousel-rating {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--rating-color);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
.carousel-review-count { color: var(--text-secondary); font-size: 0.85rem; }

/* Star rendering */
.stars .star {
    display: inline-block;
    position: relative;
    font-size: 0.95rem;
    line-height: 1;
    margin-right: 0.08rem;
}
.stars .star.full { color: var(--rating-color); }
.stars .star.empty { color: var(--text-secondary); }
.stars .star.half { color: var(--text-secondary); }
.stars .star.half .star-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    color: var(--rating-color);
}
.stars .star.half .star-empty { color: var(--text-secondary); }

.product-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    min-height: 2.2em;
}

.product-info .category {
    display: inline-block;
    background-color: var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    width: fit-content;
}

.product-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.4;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-color);
}

.add-to-cart-btn {
    flex: 1;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.add-to-cart-btn:hover {
    background-color: #0052a3;
}

.add-to-cart-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.product-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-input {
    width: 50px;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/*  ABOUT & CONTACT PAGES */
.content-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.content-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.content-section h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.content-section ul {
    margin-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.content-section li {
    margin-bottom: 0.5rem;
}

.contact-form {
    margin-top: 2rem;
}

/*  NOTIFICATIONS */
.notifications-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    will-change: transform;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background-color: #4caf50;
    color: white;
}

.notification.error {
    background-color: #f44336;
    color: white;
}

.notification.info {
    background-color: var(--accent-color);
    color: white;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    margin-left: 1rem;
}

/*  FOOTER */
footer {
    background-color: #1a1a1a;
    color: #ffffff;
    margin-top: auto;
    padding-top: 3rem;
}

body[data-theme="dark"] footer {
    background-color: #0a0a0a;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #ffffff;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin: 0.5rem 0;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #333333;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background-color 0.3s ease;
}

.social-link:hover {
    background-color: var(--accent-color);
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #333333;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #999999;
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-legal {
    display: flex;
    gap: 2rem;
}

.footer-legal a {
    color: #999999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: var(--accent-color);
}

/*  RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .navbar { top: 64px; }

    .nav-toggle { display: block; min-width: 44px; min-height: 44px; }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--nav-bg);
        position: absolute;
        left: 0;
        top: 100%;
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
        border-bottom: 2px solid var(--nav-border);
        z-index: 98;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-content { position: relative; }

    .nav-link {
        display: block;
        padding: 1rem;
        width: 100%;
        border-bottom: 1px solid rgba(0,0,0,0.03);
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    header h1 {
        font-size: 1.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cart-icon-btn {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
        padding: 0 1rem;
    }

    .products-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .search-filter-container {
        flex-direction: column;
    }

    .search-input,
    .category-filter {
        width: 100%;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .products-container {
        padding: 0 1rem;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 14px;
    }

    .page-container {
        padding: 1rem;
    }

    header {
        padding: 0.5rem 0;
    }

    .header-content {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .navbar { top: 56px; }

    header h1 {
        font-size: 1.1rem;
    }

    .logo {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .logo-text {
        font-size: 0.65rem;
    }

    .nav-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .cart-icon-btn {
        padding: 0.6rem 0.5rem;
        font-size: 1rem;
    }

    .hero-section {
        padding: 1.5rem 1rem;
    }

    .hero-section h1 {
        font-size: 1.4rem;
    }

    .hero-section p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature {
        padding: 1rem;
    }

    .feature h3 {
        font-size: 1.1rem;
    }

    .items-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }

    .item-card {
        flex-direction: row;
        height: auto;
        gap: 0.75rem;
    }

    .item-image {
        width: 90px;
        height: 90px;
        flex-shrink: 0;
        border-radius: 4px;
    }

    .product-info {
        padding: 0.75rem;
        gap: 0.25rem;
    }

    .product-info h3 {
        font-size: 1rem;
    }

    input,
    textarea,
    select,
    button {
        font-size: 16px;
        min-height: 44px;
    }

    button {
        min-width: 44px;
    }

    .content-section {
        padding: 1rem;
        margin: 1rem 0;
    }

    .content-section h2 {
        font-size: 1.5rem;
    }

    .footer-content {
        padding: 0 1rem;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .footer-legal {
        flex-direction: column;
        gap: 0.5rem;
    }

    .notifications-container {
        right: 8px;
        left: 8px;
        top: 110px;
        max-width: none;
    }

    .notification {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .item-image {
        height: 150px;
    }

    .delete-btn, .edit-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .cart-icon-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ORDERS PAGE */
.orders-list {
    display: grid;
    gap: 1.5rem;
}

.no-orders {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-size: 1.1rem;
}

.order-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.order-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.order-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.order-id {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.order-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.order-total {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1.05rem;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--bg-primary);
    border-radius: 0.25rem;
}

.order-item-name {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.order-item-qty {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.order-item-price {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 60px;
    text-align: right;
}

@media (max-width: 600px) {
    .order-header {
        grid-template-columns: auto 1fr;
    }

    .order-total {
        grid-column: 1 / -1;
        text-align: right;
    }

    .order-item {
        grid-template-columns: 1fr auto;
    }

    .order-item-qty {
        grid-column: 1 / -1;
        text-align: left;
        font-size: 0.8rem;
    }
}
.checkout {
    max-width: 420px;
    width: 100%;
    padding: 1.25rem;
}

.checkout input {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    border-radius: 10px;
    min-height: 44px;
}

/* Bigger tap targets for buttons */
.checkout button {
    min-height: 44px;
}

.checkout-section {
    margin-bottom: 1.25rem;
}

.checkout-section h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

/* Checkout summary */
.checkout-summary {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--accent-color);
}

.checkout-summary p {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.modal-content.success {
    text-align: center;
    max-width: 400px;
}

.modal-content.success h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #059669;
}

.modal-content.success p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.modal-content.success .order-summary {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.modal-content.success .order-summary p {
    margin: 0.5rem 0;
    text-align: left;
    font-size: 0.95rem;
}

.card-row {
    display: flex;
    gap: 0.75rem;
}

/* Primary CTA */
.checkout-btn.primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
    border-radius: 12px;
    margin-top: 0.75rem;
}

/* Payment note */
.payment-note {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.secure-note {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Express payment buttons */
.express-payments {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pay-btn {
    flex: 1;
    padding: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: not-allowed;
    transition: opacity 0.3s ease;
}

.pay-btn:disabled {
    opacity: 0.6;
}

.apple-pay {
    background: #000;
    color: #fff;
}

.google-pay {
    background: #fff;
    color: #000;
    border: 1px solid #ddd;
}

.express-note {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

/* Mobile sticky "Place Order" button */
@media (max-width: 480px) {
    .checkout-btn.primary {
        position: sticky;
        bottom: 0;
        width: 100%;
        z-index: 10;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    }

    .modal-content.checkout {
        padding-bottom: 5rem; 
    }
}

/* ADMIN ANALYTICS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
}

.stat-card p {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
}

#top-products li,
#conversion-funnel li {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Sales bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 180px;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.bar {
    flex: 1;
    background: linear-gradient(180deg, #0066cc 0%, #0047a3 100%);
    border-radius: 6px 6px 0 0;
    position: relative;
    min-width: 24px;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.bar span {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

/* Date filter inputs */
.date-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.date-filters input,
.date-filters .btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Order details panel */
.order-details {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 1rem;
}

.order-details.hidden {
    display: none;
}

.order-details h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.order-details p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
}

.order-details ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.order-details li {
    margin: 0.25rem 0;
    color: var(--text-secondary);
}

.order-details strong {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-primary);
}

#orders-list button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

#orders-list button:hover {
    background-color: var(--bg-primary);
}
