/* YoungCoders Electronics - "Circuit Teal" color scheme */
:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --brand: #ff7a1a;
    --brand-dark: #d95d00;
    --text: #1e293b;
    --muted: #64748b;
    --bg: #f8fafc;
    --bg-soft: #f0fdfa;
    --white: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --max-w: 1200px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); line-height: 1.6; background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

/* --- Header --- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--white); box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1.25rem; }
.logo img { height: 100px; width: auto; }
.main-nav { display: flex; gap: 1.5rem; align-items: center; }
.main-nav a { color: var(--text); font-weight: 500; text-decoration: none; }
.main-nav a:hover { color: var(--primary); text-decoration: none; }
.nav-tagline {
    color: var(--primary-dark); font-size: 1rem; font-weight: 700;
    letter-spacing: -0.3px;
    padding-right: 1.25rem; border-right: 2px solid var(--primary);
    margin-right: 0.75rem;
}
.btn-nav {
    background: var(--primary); color: #fff !important;
    padding: 0.5rem 1.1rem; border-radius: var(--radius); text-decoration: none !important;
    font-weight: 600;
}
.btn-nav:hover { background: var(--primary-dark); }
.cart-badge { background: var(--brand); color: #fff; border-radius: 50%; padding: 1px 6px; font-size: 0.7rem; font-weight: 700; margin-left: 5px; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* --- Buttons --- */
.btn {
    display: inline-block; padding: 0.85rem 1.75rem; border-radius: var(--radius);
    font-weight: 600; cursor: pointer; border: none; transition: transform .15s ease, background .2s ease;
    text-decoration: none; text-align: center;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; }
.btn-disabled { background: #cbd5e1; color: #94a3b8; cursor: not-allowed; }

/* --- Products Section --- */
.products-section { padding: 2rem 0 4rem; }
.products-layout { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; align-items: start; }
.sidebar-column { display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 130px; }

/* Filters Sidebar */
.filters-sidebar {
    background: var(--white); padding: 1.5rem; border-radius: var(--radius);
    border: 1px solid var(--border);
}
.filters-sidebar h3 { margin-bottom: 1rem; font-size: 1.1rem; color: var(--primary-dark); }
.filter-group { margin-bottom: 1.25rem; }
.filter-group h4 { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-option { display: block; padding: 4px 0; cursor: pointer; font-size: 0.9rem; }
.filter-option input { margin-right: 8px; accent-color: var(--primary); }
.filter-input {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 0.9rem;
}
.filter-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,0.1); }

/* Track Order sidebar box */
.track-sidebar-box {
    background: var(--bg-soft); padding: 1.5rem; border-radius: var(--radius);
    border: 2px solid var(--primary); text-align: center;
}
.track-sidebar-box h4 { color: var(--primary-dark); margin-bottom: 0.4rem; }
.track-sidebar-box p { font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem; }

/* Product Grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.5rem; }
.products-grid-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.product-card {
    background: var(--white); border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-image {
    position: relative; padding: 1.5rem; background: var(--bg-soft);
    text-align: center; height: 220px; display: flex; align-items: center; justify-content: center;
}
.product-image img { max-width: 90%; max-height: 190px; object-fit: contain; }
.product-info { padding: 1rem 1.25rem 1.25rem; }
.product-category { font-size: 0.7rem; color: var(--primary); text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.product-name { font-size: 1rem; margin: 4px 0 8px; }
.product-name a { color: var(--text); text-decoration: none; }
.product-name a:hover { color: var(--primary); }
.product-desc { font-size: 0.85rem; color: var(--muted); margin-bottom: 12px; }
.product-price { font-size: 1rem; margin-bottom: 12px; color: var(--text); }
.product-actions { display: flex; gap: 8px; }

/* Badges */
.badge { position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-lg { font-size: 0.8rem; padding: 6px 14px; }

/* --- Product Detail --- */
.product-detail { padding: 2rem 0 4rem; }
.breadcrumb { margin-bottom: 1.5rem; font-size: 0.85rem; color: var(--muted); }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.product-detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.product-detail-image {
    background: var(--bg-soft); border-radius: var(--radius); padding: 2rem;
    text-align: center; position: relative; display: flex; align-items: center; justify-content: center;
    min-height: 400px;
}
.product-detail-image img { max-width: 95%; max-height: 380px; object-fit: contain; }
.product-detail-info h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.product-description { color: var(--muted); margin-bottom: 1.25rem; line-height: 1.7; }
.product-highlights { margin-bottom: 1.5rem; }
.product-highlights ul { list-style: none; padding: 0; }
.product-highlights li { padding: 4px 0; padding-left: 20px; position: relative; }
.product-highlights li::before { content: "\2713"; position: absolute; left: 0; color: var(--primary); font-weight: bold; }
.product-category-tag { display: inline-block; background: var(--bg-soft); color: var(--primary-dark); padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; margin-bottom: 8px; border: 1px solid rgba(13,148,136,0.2); }

/* Variants */
.variant-selector { margin-bottom: 1.5rem; }
.variant-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius);
    margin-bottom: 8px; cursor: pointer; transition: border-color 0.2s;
}
.variant-option.active, .variant-option:hover { border-color: var(--primary); background: var(--bg-soft); }
.variant-option input { display: none; }
.variant-label { font-weight: 500; }
.variant-price { font-weight: 700; color: var(--primary-dark); }

/* Quantity */
.quantity-selector { margin-bottom: 1.5rem; }
.qty-controls { display: flex; align-items: center; }
.qty-btn { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--white); cursor: pointer; font-size: 1.2rem; border-radius: var(--radius); }
.qty-btn:hover { background: var(--bg-soft); }
#qty-input { width: 50px; height: 36px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); margin: 0 4px; font-size: 1rem; }

.btn-add-cart { width: 100%; }
.add-feedback { color: var(--success); font-weight: 600; margin-top: 12px; }

/* --- Cart --- */
.cart-section { padding: 2rem 0 4rem; }
.cart-empty { text-align: center; padding: 4rem 1rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.cart-layout { display: grid; grid-template-columns: 1fr 350px; gap: 2rem; }
.cart-item {
    display: flex; align-items: center; gap: 1rem; padding: 1rem;
    background: var(--white); border-radius: var(--radius); margin-bottom: 0.75rem;
    border: 1px solid var(--border);
}
.cart-item-info { flex: 1; }
.cart-item-info h4 { margin-bottom: 4px; }
.cart-item-variant { font-size: 0.85rem; color: var(--muted); }
.cart-item-price { font-size: 0.85rem; color: var(--muted); }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-subtotal { min-width: 100px; text-align: right; }
.cart-item-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1.2rem; padding: 8px; }

.cart-summary {
    background: var(--white); padding: 1.5rem; border-radius: var(--radius);
    border: 1px solid var(--border); height: fit-content; position: sticky; top: 130px;
}
.cart-summary h3 { margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.summary-total { font-size: 1.2rem; font-weight: 700; border-bottom: none; margin: 0.75rem 0; }
.cart-summary .btn { margin-top: 0.75rem; }

/* --- Checkout --- */
.checkout-section { padding: 2rem 0 4rem; }
.checkout-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.checkout-items { background: var(--white); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.checkout-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.checkout-total { padding: 1rem 0 0; font-size: 1.2rem; }
.checkout-form { background: var(--white); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.form-note { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.25rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 1rem; transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,0.1); }
.field-error { display: block; color: var(--danger); font-size: 0.8rem; margin-top: 4px; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* --- FAQ --- */
.faq-section { padding: 2rem 0 4rem; }
.faq-list { margin-top: 1.5rem; }
.faq-item { background: var(--white); border-radius: var(--radius); margin-bottom: 0.75rem; border: 1px solid var(--border); }
.faq-item summary { padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; }
.faq-item p { padding: 0 1.25rem 1rem; color: var(--muted); }

/* --- Order Status --- */
.order-status-section { padding: 4rem 0; text-align: center; }
.order-lookup { background: var(--white); padding: 2.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.order-note { color: var(--muted); margin: 1rem 0 1.5rem; }

/* --- Footer --- */
.site-footer { background: #0f172a; color: #d1d5db; padding: 3rem 0 1rem; margin-top: auto; }
.footer-grid {
    display: grid; gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.footer-grid h4 { color: #fff; margin-bottom: 0.75rem; }
.social-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.social-links a { color: var(--brand); text-decoration: none; }
.social-links a:hover { text-decoration: underline; }
.footer-bottom { text-align: center; padding-top: 1.5rem; margin-top: 2rem; border-top: 1px solid #1e293b; font-size: 0.85rem; }

/* --- Admin --- */
.admin-body { background: var(--bg); }
.admin-login-card {
    max-width: 400px; margin: 100px auto; background: var(--white);
    padding: 2.5rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); text-align: center;
}
.admin-login-card h1 { margin-bottom: 8px; }
.admin-login-card p { color: var(--muted); margin-bottom: 1.5rem; }
.admin-container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--white); padding: 1.25rem; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); }
.stat-count { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }
.admin-section { background: var(--white); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-section h2 { margin-bottom: 1rem; }
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: 0.75rem; }
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; }
.status-pending_payment { background: #fef3c7; color: #92400e; }
.status-payment_confirmed { background: #d1fae5; color: #065f46; }
.status-processing { background: #e0f2fe; color: #0369a1; }
.status-shipped { background: #ede9fe; color: #5b21b6; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.8rem; }

/* Related */
.related-products { margin-top: 3rem; }
.related-products h2 { margin-bottom: 1.5rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .products-layout { grid-template-columns: 1fr; }
    .filters-sidebar { position: static; }
    .product-detail-layout { grid-template-columns: 1fr; }
    .cart-layout { grid-template-columns: 1fr; }
    .checkout-layout { grid-template-columns: 1fr; }
    .nav-tagline { display: none; }
    .main-nav { display: none; }
    .nav-toggle { display: block; }
    .product-image { height: 180px; }
}
