/* --- GENERAL PAGE STYLE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Josefin Sans', 'Segoe UI', Tahoma, Geneva, Verdana, Arial, sans-serif;
}
body {
    background-color: #f4f6f9;
    color: #333;
    padding: 0;
}
.container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 16px 20px 40px;
    text-align: center;
}

.cart-toggle-btn {
    background: #0f45b5;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge {
    background: #e53e3e;
    color: white;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 12px;
    margin-left: 5px;
}
h1 {
    color: #1a202c;
    margin-bottom: 0;
}

/* --- HERO BANNER (compact + centered) --- */
.hero-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px 14px;
    margin-bottom: 14px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}
.hero-text {
    flex: 1;
    max-width: 620px;
    text-align: center;
}
.hero-eyebrow {
    display: inline-block;
    background: #e0ecff;
    color: #0f45b5;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 6px;
}
.hero-banner h1 {
    color: #1a202c;
    font-size: clamp(22px, 3.5vw, 30px);
    margin-bottom: 6px;
    line-height: 1.2;
}
.hero-subtitle {
    color: #718096;
    font-size: 14px;
    margin: 0 auto 10px;
    line-height: 1.4;
}

/* --- CATEGORY TABS --- */
.category-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.tab-btn {
    flex: 0 0 auto;
    padding: 0 16px;
    height: 34px;
    border: 1.5px solid #0f45b5;
    background-color: white;
    color: #0f45b5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tab-btn:hover {
    background-color: #edf2f7;
}
.tab-btn.active {
    background-color: #0f45b5;
    color: white;
}

/* --- PHONE CARDS LAYOUT --- */
.phone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.phone-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    text-align: left;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.phone-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 26px rgba(0,0,0,0.08);
    cursor: pointer;
}

/* Image zone */
.phone-img-wrap {
    position: relative;
    background: #f6f8fc;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 190px;
}
.phone-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    transition: transform 0.3s ease;
}
.phone-card:hover .phone-img {
    transform: scale(1.04);
}

/* "Best Seller" style badge pill */
.badge-pill {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #0f45b5;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 999px;
    z-index: 2;
}
.badge-pill.refurbished {
    background: #dd6b20;
}
.badge-pill.value-pick {
    background: #10c957;
}
.badge-pill.hot-deal {
    background: #e53e3e;
}
.badge-pill.top-rated {
    background: #805ad5;
}
.badge-pill.new-arrival {
    background: #0bb5d6;
}
.badge-pill.budget-friendly {
    background: #d69e2e;
}

/* Info section under the image */
.phone-info {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.brand-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 6px;
}
.phone-card h3 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
    line-height: 1.3;
}
.phone-card .specs {
    font-size: 13px;
    color: #718096;
    margin-bottom: 18px;
}
.price-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}
.price-block {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.price {
    font-size: 21px;
    font-weight: 600;
    color: #0f172a;
}
.original-price {
    font-size: 14px;
    font-weight: 500;
    color: #a0aec0;
    text-decoration: line-through;
}

/* --- ACTION BUTTONS ROW --- */
.button-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
    align-items: center;
}
.phone-card .buy-btn {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: background-color 0.2s;
    border: none;
}
.btn-now {
    flex: 1;
    background-color: #0f45b5;
    color: white;
    text-decoration: none;
}
.btn-now:hover {
    background-color: #0b3a99;
}
.btn-cart {
    width: 38px;
    background-color: #edf2f7;
    color: #0f45b5;
}
.btn-cart svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.btn-cart:hover {
    background-color: #cbd5e0;
}

/* --- CARD ACTION BUTTONS (product grid: green pill + round blue cart) --- */
.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.card-buy-btn {
    background-color: #0a8a3a;
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.card-buy-btn:hover {
    background-color: #076f2e;
}
.card-cart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #0f45b5;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s;
}
.card-cart-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}
.card-cart-btn:hover {
    background-color: #0b3a99;
}
.whatsapp-btn {
    width: 38px;
    font-size: 16px;
    background-color: #25D366;
    color: white;
}
.whatsapp-btn:hover {
    background-color: #128C7E;
}

/* --- SPECIFICATIONS MODAL --- */
.specs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.specs-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.specs-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.specs-modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
.specs-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
}
.specs-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 18px;
    background: #edf2f7;
}
#specs-name {
    color: #1a202c;
    margin-bottom: 6px;
}
.specs-modal .price {
    margin-bottom: 18px;
}
.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.specs-table tr {
    border-bottom: 1px solid #edf2f7;
}
.specs-table tr:last-child {
    border-bottom: none;
}
.specs-table td {
    padding: 10px 0;
    font-size: 14px;
}
.specs-table td:first-child {
    color: #718096;
    font-weight: 600;
    width: 40%;
}
.specs-table td:last-child {
    color: #2d3748;
}

/* --- CART DRAWER --- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.cart-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    padding: 25px;
    transition: right 0.3s ease;
    z-index: 1000;
    text-align: left;
}
.cart-drawer.open {
    right: 0;
}
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #a0aec0;
    line-height: 1;
}
.close-btn:hover {
    color: #4a5568;
}
#cart-items-body {
    flex-grow: 1;
    overflow-y: auto;
}
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
}
.cart-item-details h4 {
    font-size: 15px;
    color: #2d3748;
}
.cart-item-details span {
    font-size: 14px;
    color: #0f45b5;
    font-weight: bold;
}
.remove-btn {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 13px;
}
.remove-btn:hover {
    text-decoration: underline;
}
.empty-msg {
    color: #a0aec0;
    margin-top: 40px;
    text-align: center;
}
.cart-footer {
    border-top: 1px solid #edf2f7;
    padding-top: 20px;
    margin-top: auto;
}
.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}
.checkout-btn {
    width: 100%;
    background-color: #0a8a3a;
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.checkout-btn:hover {
    background-color: #076f2e;
}

/* --- SITE FOOTER --- */
.site-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e2e8f0;
    text-align: left;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}
.footer-col h4 {
    color: #1a202c;
    font-size: 15px;
    margin-bottom: 14px;
}
.footer-about {
    font-size: 14px;
    color: #718096;
    line-height: 1.6;
}
.footer-col ul {
    list-style: none;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li,
.footer-col ul li a {
    font-size: 14px;
    color: #718096;
}
.footer-col ul li a {
    text-decoration: none;
    transition: color 0.15s ease;
}
.footer-col ul li a:hover {
    color: #0f45b5;
}
.footer-bottom {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #a0aec0;
}

/* --- RESPONSIVE --- */
@media (max-width: 700px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .container { padding: 12px 12px 30px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 360px) {
    .price-action-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .card-actions { width: 100%; }
    .card-buy-btn { flex: 1; }
}

/* --- FOOTER INFO MODAL --- */
.info-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1199;
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.info-overlay.active { opacity: 1; pointer-events: auto; }
.info-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: 90%; max-width: 560px; max-height: 85vh; overflow-y: auto;
    background: white; border-radius: 12px; padding: 30px; text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 1200;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.info-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.info-modal h2 { color: #1a202c; margin-bottom: 16px; padding-right: 30px; }
.info-modal h4 { color: #1a202c; margin: 16px 0 4px; font-size: 15px; }
.info-modal p, .info-modal li { font-size: 14px; color: #4a5568; line-height: 1.6; }
.info-modal ul { padding-left: 20px; }
.info-modal a { color: #0f45b5; }

/* --- SPECS MODAL ACTIONS (same buttons as product cards) --- */
.specs-actions {
    display: flex;
    justify-content: flex-end;
}

/* --- STICKY PRICE SIDEBAR --- */
.shop-layout {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}
.shop-layout .phone-grid {
    flex: 1;
    min-width: 0;
}
.price-sidebar {
    position: sticky;
    top: calc(var(--header-h, 70px) + 16px);
    flex: 0 0 200px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    text-align: left;
    z-index: 5;
}
.price-sidebar h3 {
    font-size: 14px;
    color: #1a202c;
    margin-bottom: 12px;
    padding: 0 4px;
}
.price-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.price-opt {
    border: 1px solid #cbd5e0;
    background: white;
    color: #4a5568;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 12px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}
.price-opt:hover { background: #edf2f7; }
.price-opt.active {
    background: #0f45b5;
    border-color: #0f45b5;
    color: white;
}

/* Mobile: sidebar becomes a sticky scrolling chip bar */
@media (max-width: 800px) {
    .shop-layout { flex-direction: column; gap: 16px; }
    .price-sidebar {
        flex: none;
        width: 100%;
        top: var(--header-h, 70px);
        padding: 10px 12px;
        border-radius: 10px;
    }
    .price-sidebar h3 { margin-bottom: 8px; }
    .price-options { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
    .price-opt { white-space: nowrap; flex-shrink: 0; }
}

/* --- OUT OF STOCK (still visible, just not buyable) --- */
.phone-card.out-of-stock .phone-img { opacity: 0.45; filter: grayscale(1); }
.phone-card.out-of-stock h3,
.phone-card.out-of-stock .price { color: #94a3b8; }
.badge-pill.out-of-stock-pill { background: #64748b; }
.card-buy-btn.sold-out,
.card-buy-btn.sold-out:hover {
    background-color: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
}
.card-cart-btn:disabled,
.card-cart-btn:disabled:hover {
    background-color: #cbd5e0;
    cursor: not-allowed;
}


/* --- HERO HEADLINE COLOURS --- */
.hero-black { color: #000000; }
.hero-blue  { color: #0f45b5; }

/* --- THEME TOGGLE BUTTON --- */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffffff;
    color: #1a202c;
    border: 2px solid #0f45b5;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.theme-toggle-btn:hover { background: #edf2f7; }
@media (max-width: 480px) {
    .theme-toggle-btn { width: 100%; }
}

/* =====================================================
   DARK THEME  (applied via <html data-theme="dark">)
   ===================================================== */
html[data-theme="dark"] body { background-color: #0f172a; color: #e2e8f0; }
html[data-theme="dark"] h1,
html[data-theme="dark"] .hero-banner h1,
html[data-theme="dark"] .footer-col h4,
html[data-theme="dark"] .price-sidebar h3,
html[data-theme="dark"] .info-modal h2,
html[data-theme="dark"] .info-modal h4,
html[data-theme="dark"] #specs-name { color: #f1f5f9; }

/* First half of the headline is black in light mode, so it flips to white here */
html[data-theme="dark"] .hero-black { color: #ffffff; }
html[data-theme="dark"] .hero-blue  { color: #5b9bff; }

html[data-theme="dark"] .hero-banner,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .footer-bottom { border-color: #334155; }
html[data-theme="dark"] .hero-eyebrow { background: #1e293b; color: #5b9bff; }
html[data-theme="dark"] .hero-subtitle,
html[data-theme="dark"] .footer-about,
html[data-theme="dark"] .footer-col ul li,
html[data-theme="dark"] .footer-col ul li a,
html[data-theme="dark"] .phone-card .specs { color: #94a3b8; }
html[data-theme="dark"] .footer-col ul li a:hover { color: #5b9bff; }
html[data-theme="dark"] .footer-bottom { color: #64748b; }

/* Inputs */
html[data-theme="dark"] .top-bar input,
html[data-theme="dark"] .top-bar select {
    background: #1e293b; color: #e2e8f0; border-color: #475569;
}
html[data-theme="dark"] .top-bar input::placeholder { color: #94a3b8; }

/* Buttons */
html[data-theme="dark"] .tab-btn { background: #1e293b; color: #5b9bff; border-color: #5b9bff; }
html[data-theme="dark"] .tab-btn:hover { background: #334155; }
html[data-theme="dark"] .tab-btn.active { background: #0f45b5; border-color: #0f45b5; color: #fff; }
html[data-theme="dark"] .theme-toggle-btn { background: #1e293b; color: #f1f5f9; border-color: #5b9bff; }
html[data-theme="dark"] .theme-toggle-btn:hover { background: #334155; }

/* Product cards */
html[data-theme="dark"] .phone-card {
    background: #1e293b; border-color: #334155; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .phone-card:hover { box-shadow: 0 14px 26px rgba(0,0,0,0.5); }
html[data-theme="dark"] .phone-img-wrap { background: #162033; }
html[data-theme="dark"] .phone-card h3,
html[data-theme="dark"] .price { color: #f1f5f9; }
html[data-theme="dark"] .brand-label { color: #64748b; }
html[data-theme="dark"] .original-price { color: #64748b; }
html[data-theme="dark"] .phone-card.out-of-stock h3,
html[data-theme="dark"] .phone-card.out-of-stock .price { color: #64748b; }
html[data-theme="dark"] .card-buy-btn.sold-out,
html[data-theme="dark"] .card-buy-btn.sold-out:hover { background-color: #334155; color: #94a3b8; }
html[data-theme="dark"] .card-cart-btn:disabled,
html[data-theme="dark"] .card-cart-btn:disabled:hover { background-color: #475569; }

/* Price sidebar */
html[data-theme="dark"] .price-sidebar { background: #1e293b; border-color: #334155; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
html[data-theme="dark"] .price-opt { background: #0f172a; color: #cbd5e0; border-color: #475569; }
html[data-theme="dark"] .price-opt:hover { background: #334155; }
html[data-theme="dark"] .price-opt.active { background: #0f45b5; border-color: #0f45b5; color: #fff; }

/* Modals */
html[data-theme="dark"] .specs-modal,
html[data-theme="dark"] .info-modal { background: #1e293b; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
html[data-theme="dark"] .specs-img { background: #162033; }
html[data-theme="dark"] .specs-table tr { border-color: #334155; }
html[data-theme="dark"] .specs-table td:first-child { color: #94a3b8; }
html[data-theme="dark"] .specs-table td:last-child { color: #e2e8f0; }
html[data-theme="dark"] .info-modal p,
html[data-theme="dark"] .info-modal li { color: #cbd5e0; }
html[data-theme="dark"] .info-modal a { color: #5b9bff; }

/* Cart drawer */
html[data-theme="dark"] .cart-drawer { background-color: #1e293b; box-shadow: -5px 0 15px rgba(0,0,0,0.5); color: #e2e8f0; }
html[data-theme="dark"] .cart-header,
html[data-theme="dark"] .cart-item,
html[data-theme="dark"] .cart-footer { border-color: #334155; }
html[data-theme="dark"] .cart-header h2,
html[data-theme="dark"] .cart-item-details h4 { color: #f1f5f9; }
html[data-theme="dark"] .cart-item-details span { color: #5b9bff; }
html[data-theme="dark"] .close-btn { color: #94a3b8; }
html[data-theme="dark"] .close-btn:hover { color: #e2e8f0; }
html[data-theme="dark"] .empty-msg { color: #94a3b8; }

/* --- THEME TOGGLE: icon-only, top-left corner --- */
.theme-toggle-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    z-index: 50;
}
.theme-toggle-btn svg { display: block; }
@media (max-width: 480px) {
    .theme-toggle-btn { width: 40px; top: 10px; left: 10px; }
}


/* =====================================================
   STICKY TOP BAR
   ===================================================== */
.top-bar {
    position: sticky; top: 0; z-index: 900;
    background: #ffffff; border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.top-bar-inner {
    max-width: 1150px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; gap: 12px;
}
.brand {
    flex: 0 0 auto; font-size: 21px; font-weight: 800; letter-spacing: -0.02em;
    color: #0f45b5; text-decoration: none;
}
.top-bar input {
    flex: 1 1 160px; min-width: 0; max-width: 340px;
    padding: 8px 14px; border: 1px solid #cbd5e0; border-radius: 6px;
    font-size: 14px; outline: none;
}
.top-bar input:focus { border-color: #0f45b5; }
.top-bar .cart-toggle-btn { margin-left: auto; padding: 8px 14px; }
#product-grid { scroll-margin-top: calc(var(--header-h, 70px) + 12px); }

/* Theme toggle: right side of the bar, no ring */
.theme-toggle-btn {
    position: static; width: 40px; height: 40px; padding: 0;
    border: none; background: transparent; color: #0f45b5; border-radius: 50%;
}
.theme-toggle-btn:hover { background: #edf2f7; }
html[data-theme="dark"] .top-bar { background: #0f172a; border-color: #334155; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
html[data-theme="dark"] .brand { color: #5b9bff; }
html[data-theme="dark"] .top-bar input:focus { border-color: #5b9bff; }
html[data-theme="dark"] .theme-toggle-btn { background: transparent; border: none; color: #f1f5f9; }
html[data-theme="dark"] .theme-toggle-btn:hover { background: #334155; }

/* =====================================================
   BANNER CAROUSEL
   ===================================================== */
.banner-carousel { border-radius: 16px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.banner-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain; scrollbar-width: none;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide {
    flex: 0 0 100%; scroll-snap-align: start; position: relative; overflow: hidden;
    min-height: 200px; padding: 26px 18px; display: flex; align-items: center; justify-content: center;
}
.banner-slide::before, .banner-slide::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.banner-slide > * { position: relative; z-index: 1; }
.banner-slide h1, .banner-slide h2 { font-size: clamp(22px, 3.5vw, 30px); line-height: 1.2; margin-bottom: 6px; }
.banner-slide h2 { color: #ffffff; }
.banner-slide h2 span { color: #bcd4ff; }

.banner-welcome { background: linear-gradient(135deg, #eaf1ff 0%, #ffffff 65%); }
.banner-welcome::before { width: 220px; height: 220px; right: -60px; top: -80px; background: rgba(15,69,181,0.08); }
.banner-welcome::after { width: 120px; height: 120px; left: -40px; bottom: -50px; background: rgba(15,69,181,0.06); }
html[data-theme="dark"] .banner-welcome { background: linear-gradient(135deg, #1e293b 0%, #0f172a 70%); }
html[data-theme="dark"] .banner-welcome::before, html[data-theme="dark"] .banner-welcome::after { background: rgba(91,155,255,0.12); }

.banner-phones { background: linear-gradient(120deg, #0b3a99, #1d5fd8); }
.banner-phones::before { width: 260px; height: 260px; right: -60px; top: -90px; background: rgba(255,255,255,0.12); }
.banner-phones::after { width: 140px; height: 140px; right: 18%; bottom: -70px; background: rgba(255,255,255,0.08); }

.banner-accessories { background: linear-gradient(135deg, #0f172a, #1e293b); }
.banner-accessories::before { width: 230px; height: 230px; left: -70px; bottom: -100px; background: rgba(91,155,255,0.25); }
.banner-accessories::after { width: 120px; height: 120px; right: 8%; top: -45px; border: 3px solid rgba(91,155,255,0.5); }

.banner-whatsapp { background: linear-gradient(120deg, #075e2c, #0a8a3a); }
.banner-whatsapp::before { width: 250px; height: 250px; right: -70px; bottom: -110px; background: rgba(255,255,255,0.12); }
.banner-whatsapp::after { width: 110px; height: 110px; left: 6%; top: -50px; border: 3px solid rgba(255,255,255,0.3); }

.banner-tag {
    display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,0.18); color: #ffffff; margin-bottom: 8px;
}
.banner-sub { color: rgba(255,255,255,0.9); font-size: 14px; line-height: 1.4; margin: 0 auto 12px; }
@media (min-width: 701px) {
    .banner-phones, .banner-whatsapp { justify-content: flex-start; padding-left: 8%; }
    .banner-phones .hero-text, .banner-whatsapp .hero-text { text-align: left; }
    .banner-phones .banner-sub, .banner-whatsapp .banner-sub { margin-left: 0; }
}

.banner-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 18px; }
.banner-dot { width: 8px; height: 8px; padding: 0; border: none; border-radius: 999px; background: #cbd5e0; cursor: pointer; transition: all 0.25s ease; }
.banner-dot.active { width: 22px; background: #0f45b5; }
html[data-theme="dark"] .banner-dot { background: #334155; }
html[data-theme="dark"] .banner-dot.active { background: #5b9bff; }

/* --- Top bar on tablets / phones: brand + cart + theme on row 1, search row 2, tabs row 3 --- */
@media (max-width: 900px) {
    .top-bar-inner { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
    .brand { order: 1; }
    .top-bar .cart-toggle-btn { order: 2; }
    .theme-toggle-btn { order: 3; width: 36px; height: 36px; }
    .top-bar input { order: 4; flex: 1 1 100%; max-width: none; padding: 7px 12px; }
    .category-tabs { order: 5; flex: 1 1 100%; }
    .tab-btn { flex: 1; padding: 0 6px; height: 32px; font-size: 13px; }
}

/* Make form controls use the site font */
button, input, select, textarea { font-family: inherit; }

/* Moon icon (light theme) is black; the sun icon in dark theme stays light */
.theme-toggle-btn { color: #000000; }

/* =====================================================
   BRAND LOGO (replaces the text shop name in the top bar)
   ===================================================== */
.brand { display: inline-flex; align-items: center; }
.brand-logo {
    display: block; box-sizing: border-box; height: 42px; width: auto;
    padding: 2px 8px; background: #ffffff;
    border: 1.5px solid #0f45b5; border-radius: 8px;   /* same outline + corner radius as the tab buttons */
}
html[data-theme="dark"] .brand-logo { border-color: #5b9bff; }

/* =====================================================
   PHONE LAYOUT: price range sits below the banners as one
   horizontal row of chips (swipe sideways), not sticky, so the
   product cards get the full screen width
   ===================================================== */
@media (max-width: 800px) {
    .shop-layout { flex-direction: column; align-items: stretch; gap: 14px; }
    .price-sidebar { position: sticky; top: var(--header-h, 70px); z-index: 50; flex: none; width: 100%; padding: 10px 12px; }
    .price-sidebar h3 { font-size: 14px; margin-bottom: 8px; }
    .price-options { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 2px; }
    .price-opt { width: auto; flex-shrink: 0; white-space: nowrap; font-size: 13px; padding: 8px 14px; }
    .shop-layout .phone-grid { width: 100%; gap: 20px; }
    .brand-logo { height: 38px; }
}

/* Cart button is just an icon with a count badge */
.top-bar .cart-toggle-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; }
.cart-toggle-btn .cart-icon { display: block; }
.cart-toggle-btn .badge { position: absolute; top: -7px; right: -7px; margin-left: 0; min-width: 18px; padding: 1px 5px; line-height: 16px; text-align: center; font-size: 11px; border-radius: 999px; }

/* Four category tabs must fit on one line on phones */
@media (max-width: 480px) {
    .category-tabs { gap: 6px; }
    .tab-btn { white-space: nowrap; font-size: 12px; padding: 0 4px; }
}
