/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ===== UTILITIES ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ===== HEADER ===== */
.header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.header-logo {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.6px;
}
.header-logo .logo-mark { font-weight: 900; }
.header-logo .logo-accent { color: #0ea5e9; font-weight: 800; }
.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}
.header-nav a {
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
    transition: color 0.2s;
}
.header-nav a:hover { color: #0f172a; }
.header-nav a.active { color: #3b82f6; }
.cart-btn {
    position: relative;
    background: none;
    border: none;
    padding: 6px;
    color: #475569;
    transition: color 0.2s;
}
.cart-btn:hover { color: #0f172a; }
.cart-btn svg { width: 24px; height: 24px; }
.cart-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    background: #3b82f6;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-badge:empty { display: none; }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}
.hero h1 {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
}
.hero p {
    font-size: 18px;
    color: #94a3b8;
    max-width: 560px;
    margin: 0 auto 32px;
}
.hero-search {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.hero-search input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    font-size: 15px;
    color: #1e293b;
    outline: none;
}
.hero-search button {
    padding: 14px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
}
.hero-search button:hover { background: #2563eb; }

/* ===== CATEGORIES BAR ===== */
.categories-bar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 0;
}
.categories-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.categories-list::-webkit-scrollbar { display: none; }
.cat-chip {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.cat-chip:hover { border-color: #3b82f6; color: #3b82f6; }
.cat-chip.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* ===== PRODUCTS GRID ===== */
.products-section {
    padding: 48px 0 64px;
}
.section-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 28px;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
}
.product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.25s;
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.product-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #f1f5f9;
}
.product-card-img-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}
.product-card-img-placeholder svg { width: 48px; height: 48px; }
.product-card-body {
    padding: 18px;
}
.product-card-category {
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.product-card-name {
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.product-card-price {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}
.btn-add-cart {
    padding: 8px 16px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-add-cart:hover { background: #2563eb; }

/* ===== PRODUCT DETAIL ===== */
.product-detail {
    padding: 48px 0 64px;
}
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}
.product-detail-img {
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
    max-height: 500px;
    background: #f1f5f9;
}
.product-detail-img-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}
.product-detail-img-placeholder svg { width: 80px; height: 80px; }
.detail-category {
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.detail-name {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.detail-network {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 20px;
}
.detail-price {
    font-size: 30px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
}
.detail-desc-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    margin-top: 20px;
}
.detail-desc-text {
    font-size: 15px;
    color: #475569;
    line-height: 1.7;
}
.detail-add-cart {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}
.detail-add-cart .qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.qty-control button {
    width: 40px;
    height: 40px;
    background: #f8fafc;
    border: none;
    font-size: 18px;
    color: #475569;
    transition: background 0.15s;
}
.qty-control button:hover { background: #e2e8f0; }
.qty-control input {
    width: 48px;
    height: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    font-size: 15px;
    font-weight: 600;
    outline: none;
}
.btn-add-cart-lg {
    flex: 1;
    padding: 12px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-add-cart-lg:hover { background: #2563eb; }

/* ===== CART DRAWER ===== */
.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 100;
}
.cart-overlay.active { display: block; }
.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 101;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -8px 0 30px rgba(0,0,0,0.1);
}
.cart-drawer.open { right: 0; }
.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}
.cart-drawer-header h3 { font-size: 18px; font-weight: 700; }
.cart-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    padding: 4px;
}
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}
.cart-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}
.cart-item-img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.cart-item-price {
    font-size: 14px;
    color: #64748b;
}
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.cart-item-actions button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 14px;
    color: #475569;
}
.cart-item-actions span {
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}
.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 18px;
    padding: 4px;
    align-self: flex-start;
}
.cart-footer {
    border-top: 1px solid #e2e8f0;
    padding: 20px 24px;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}
.btn-checkout {
    width: 100%;
    padding: 14px;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-checkout:hover { background: #1e293b; }
.cart-empty {
    text-align: center;
    padding: 48px 0;
    color: #94a3b8;
}
.cart-empty svg { width: 48px; height: 48px; margin: 0 auto 12px; display: block; }

/* ===== FOOTER ===== */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
}
.footer a { color: #3b82f6; }

/* ===== LOADING ===== */
.loading {
    text-align: center;
    padding: 48px;
    color: #94a3b8;
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY ===== */
.empty-products {
    text-align: center;
    padding: 64px 20px;
    color: #94a3b8;
}
.empty-products svg { width: 64px; height: 64px; margin: 0 auto 16px; display: block; color: #cbd5e1; }
.empty-products p { font-size: 16px; }

/* ===== BACK LINK ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 24px;
    transition: color 0.2s;
}
.back-link:hover { color: #3b82f6; }
.back-link svg { width: 16px; height: 16px; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}
.pagination button {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s;
}
.pagination button:hover:not(:disabled) { border-color: #3b82f6; color: #3b82f6; }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination span { font-size: 14px; color: #64748b; }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #fff;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 200;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ===== FOOTER ===== */
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 48px 0 32px; }
.footer-logo { font-size: 20px; font-weight: 700; color: #f8fafc; margin-bottom: 8px; display: inline-flex; gap: 2px; letter-spacing: -0.4px; }
.footer-logo .logo-mark { font-weight: 800; color: #f8fafc; }
.footer-logo .logo-accent { color: #38bdf8; font-weight: 800; }
.footer-desc { font-size: 14px; color: #94a3b8; line-height: 1.6; }
.footer-col h4 { font-size: 14px; font-weight: 600; color: #f8fafc; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col a { display: block; font-size: 14px; color: #94a3b8; padding: 4px 0; transition: color 0.15s; }
.footer-col a:hover { color: #f8fafc; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 20px; margin-top: 8px; }
.footer-bottom p { font-size: 13px; color: #64748b; }
.footer-security {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.footer-security svg {
    width: 32px;
    height: 32px;
    color: #38bdf8;
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    color: #e2e8f0;
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.25);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
    z-index: 300;
}
.cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
}
.cookie-banner__text {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
}
.cookie-banner__text a {
    color: #38bdf8;
    text-decoration: underline;
}
.cookie-banner__actions {
    display: flex;
    gap: 8px;
}
.cookie-banner__preferences {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1 1 100%;
}
.cookie-toggle {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 10px 12px;
    flex: 1 1 240px;
}
.cookie-toggle input[type="checkbox"] {
    margin-top: 4px;
}
.cookie-toggle__label {
    display: flex;
    flex-direction: column;
    color: #e2e8f0;
}
.cookie-toggle__label strong {
    font-size: 14px;
    margin-bottom: 2px;
}
.cookie-toggle__label small {
    font-size: 12px;
    color: #94a3b8;
}
.cookie-btn {
    padding: 10px 20px;
    background: #38bdf8;
    color: #0f172a;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.cookie-btn:hover {
    background: #0ea5e9;
}
.cookie-btn.ghost {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(226, 232, 240, 0.4);
}
.cookie-btn.ghost:hover {
    background: rgba(226, 232, 240, 0.1);
}

@media (max-width: 640px) {
    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-banner__actions {
        width: 100%;
    }
    .cookie-btn {
        width: 100%;
    }
    .cookie-banner__preferences {
        flex-direction: column;
    }
}

/* ===== CONTENT PAGES ===== */
.page-content { padding: 48px 0 80px; }
.page-content h1 { font-size: 32px; font-weight: 800; color: #0f172a; margin-bottom: 24px; }
.page-body { font-size: 16px; line-height: 1.8; color: #475569; }
.page-body h2 { font-size: 22px; font-weight: 700; color: #0f172a; margin: 32px 0 12px; }
.page-body h3 { font-size: 18px; font-weight: 600; color: #0f172a; margin: 24px 0 8px; }
.page-body p { margin-bottom: 16px; }
.page-body ul, .page-body ol { margin: 0 0 16px 24px; }
.page-body li { margin-bottom: 6px; }
.page-body a { color: #3b82f6; text-decoration: underline; }
.page-body a:hover { color: #2563eb; }

/* ===== VIEW PRODUCT BUTTON (replaces Add to Cart on home) ===== */
.btn-view-product {
    padding: 8px 16px;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    display: inline-block;
}
.btn-view-product:hover { background: #1e293b; }

/* ===== AVAILABILITY BADGE ===== */
.detail-availability { margin-bottom: 12px; }
.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}
.availability-badge.available {
    background: rgba(34,197,94,0.1);
    color: #16a34a;
    border: 1px solid rgba(34,197,94,0.25);
}

/* ===== REVIEWS ===== */
.reviews-section {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid #e2e8f0;
}
.reviews-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.reviews-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 8px;
}
.reviews-avg {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}
.reviews-count {
    font-size: 14px;
    color: #64748b;
}
.star-display {
    color: #d1d5db;
    font-size: 16px;
}
.star-display.filled {
    color: #f59e0b;
}

.review-form-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 32px;
}
.review-form-wrap h3 {
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 20px;
}
.review-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.review-form-wrap .field {
    margin-bottom: 16px;
}
.review-form-wrap label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}
.review-form-wrap input[type="text"],
.review-form-wrap textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    display: block;
    box-sizing: border-box;
}
.review-form-wrap textarea {
    resize: vertical;
    min-height: 80px;
}
.review-form-wrap input[type="text"]:focus,
.review-form-wrap textarea:focus {
    border-color: #3b82f6;
}

.star-rating {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}
.star-rating .star {
    font-size: 28px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
}
.star-rating .star.active,
.star-rating .star.hover {
    color: #f59e0b;
}

.btn-submit-review {
    padding: 12px 28px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.btn-submit-review:hover { background: #2563eb; }
.btn-submit-review:disabled { opacity: 0.6; cursor: not-allowed; }

.review-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 14px;
}
.review-alert.error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    color: #dc2626;
}
.review-alert.success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    color: #16a34a;
}

.review-card {
    padding: 20px 0;
    border-bottom: 1px solid #f1f5f9;
}
.review-card:last-child { border-bottom: none; }
.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.review-author {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    display: block;
}
.review-date {
    font-size: 13px;
    color: #94a3b8;
    display: block;
    margin-top: 2px;
}
.review-stars .star-display { font-size: 14px; }
.review-text {
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
}
.no-reviews {
    text-align: center;
    padding: 32px;
    color: #94a3b8;
    font-size: 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 15px; }
    .hero { padding: 48px 0; }
    .product-detail-grid { grid-template-columns: 1fr; gap: 24px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
    .cart-drawer { width: 100vw; }
    .header-nav { gap: 16px; }
    .header-nav a.nav-link-text { display: none; }
    .review-form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
