/* ═══════════════════════════════════════════
   TechZim Shop — Custom Filtered Shop
   ═══════════════════════════════════════════ */

:root {
    --tz-bg: #FAFAF9;
    --tz-surface: #FFFFFF;
    --tz-surface-alt: #F3F3F1;
    --tz-border: #E5E5E3;
    --tz-text: #1A1A1A;
    --tz-text-muted: #8C8C8A;
    --tz-accent: #F26522;
    --tz-accent-hover: #d9561a;
    --tz-accent-light: #FFF5F0;
    --tz-success: #2a9d2a;
    --tz-danger: #e53e3e;
    --tz-radius: 10px;
    --tz-radius-sm: 6px;
    --tz-shadow: 0 1px 3px rgba(0,0,0,0.06);
    --tz-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --tz-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800;900&display=swap');

.tz-shop {
    font-family: var(--tz-font);
    color: var(--tz-text);
    background: var(--tz-bg);
    position: relative;
    /* Center within whatever container the page gives us, up to 1200px.
       For the shop to use the full 1200px on Twenty Twenty-Five, set the
       shortcode block's alignment to "Full width" in the page editor. */
    max-width: 1200px;
    width: 100%;
    margin-inline: auto;
    padding-inline: 16px;
    box-sizing: border-box;
}

.tz-shop *, .tz-shop *::before, .tz-shop *::after {
    box-sizing: border-box;
}

/* ─── Toolbar ─── */

.tz-shop-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.tz-search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.tz-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tz-text-muted);
    pointer-events: none;
}

.tz-search-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border-radius: var(--tz-radius);
    border: 1px solid var(--tz-border);
    font-size: 14px;
    font-family: var(--tz-font);
    background: var(--tz-surface);
    color: var(--tz-text);
    outline: none;
    transition: border-color 0.15s;
}

.tz-search-input:focus {
    border-color: var(--tz-accent);
}

.tz-sort-select {
    padding: 11px 14px;
    border-radius: var(--tz-radius);
    border: 1px solid var(--tz-border);
    font-size: 13px;
    font-family: var(--tz-font);
    background: var(--tz-surface);
    color: var(--tz-text);
    cursor: pointer;
    outline: none;
}

.tz-mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 11px 16px;
    border-radius: var(--tz-radius);
    border: 1px solid var(--tz-border);
    background: var(--tz-surface);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--tz-font);
    color: var(--tz-text);
    cursor: pointer;
}

.tz-filter-badge {
    background: var(--tz-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ─── Layout ─── */

.tz-shop-layout {
    display: flex;
    gap: 24px;
}

/* ─── Sidebar Filters ─── */

.tz-filters {
    width: 210px;
    flex-shrink: 0;
    padding-bottom: 80px;
}

.tz-filters-inner {
    position: sticky;
    top: 100px;
}

.tz-filter-group {
    margin-bottom: 4px;
}

.tz-filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 1px solid var(--tz-border);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--tz-font);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tz-text);
    cursor: pointer;
    transition: color 0.15s;
}

.tz-filter-heading:hover {
    color: var(--tz-accent);
}

.tz-chevron {
    transition: transform 0.2s;
}

.tz-filter-heading[aria-expanded="false"] .tz-chevron {
    transform: rotate(-90deg);
}

.tz-filter-options {
    padding: 8px 0;
    max-height: 240px;
    overflow-y: auto;
}

.tz-filter-options::-webkit-scrollbar {
    width: 4px;
}

.tz-filter-options::-webkit-scrollbar-thumb {
    background: var(--tz-border);
    border-radius: 2px;
}

.tz-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--tz-text);
    transition: opacity 0.15s;
}

.tz-filter-checkbox.tz-disabled {
    opacity: 0.55;
    cursor: default;
}

.tz-filter-checkbox input[type="checkbox"] {
    accent-color: var(--tz-accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: inherit;
}

.tz-filter-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tz-filter-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--tz-text-muted);
    background: var(--tz-surface);
    border: 1px solid var(--tz-border);
    border-radius: 10px;
    padding: 1px 8px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.tz-filter-loading {
    font-size: 12px;
    color: var(--tz-text-muted);
    padding: 8px 0;
}

/* Price slider */
.tz-price-slider {
    position: relative;
    height: 36px;
    margin: 14px 0 6px;
}

.tz-price-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tz-border);
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
}

.tz-price-track-fill {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tz-accent);
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
}

.tz-price-slider input[type="range"] {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    height: 36px;
    margin: 0;
}

.tz-price-slider input[type="range"]:focus {
    outline: none;
}

.tz-price-slider input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    background: transparent;
    height: 36px;
    border: none;
}

.tz-price-slider input[type="range"]::-moz-range-track {
    background: transparent;
    height: 36px;
    border: none;
}

.tz-price-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tz-accent);
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    pointer-events: auto;
    cursor: grab;
    margin-top: 0;
    position: relative;
    z-index: 2;
}

.tz-price-slider input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.tz-price-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tz-accent);
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    pointer-events: auto;
    cursor: grab;
}

.tz-price-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    gap: 8px;
}

.tz-price-label-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--tz-border);
    border-radius: var(--tz-radius-sm);
    background: var(--tz-surface);
}

.tz-price-label-max {
    text-align: right;
}

.tz-price-label-caption {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tz-text-muted);
}

.tz-price-label-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--tz-text);
}

/* Stock toggle */
.tz-stock-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--tz-text);
}

.tz-stock-toggle input[type="checkbox"] {
    accent-color: var(--tz-accent);
    width: 15px;
    height: 15px;
}

/* Clear button */
.tz-clear-filters {
    width: 100%;
    padding: 9px 0;
    border-radius: var(--tz-radius-sm);
    border: 1px solid var(--tz-border);
    background: none;
    color: var(--tz-text-muted);
    font-size: 12px;
    font-family: var(--tz-font);
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
}

.tz-clear-filters:hover {
    border-color: var(--tz-accent);
    color: var(--tz-accent);
}

/* ─── Product Grid ─── */

.tz-products-area {
    flex: 1;
    min-width: 0;
    padding-bottom: 80px;
}

.tz-results-summary {
    font-size: 13px;
    color: var(--tz-text-muted);
    margin-bottom: 16px;
}

.tz-results-summary strong {
    color: var(--tz-text);
}

.tz-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    transition: opacity 0.2s;
}

.tz-product-grid.tz-loading {
    opacity: 0.4;
    pointer-events: none;
}

/* ─── Product Card ─── */

.tz-product-card {
    background: var(--tz-surface);
    border-radius: var(--tz-radius);
    border: 1px solid var(--tz-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
}

.tz-product-card:hover {
    border-color: #ccc;
    box-shadow: var(--tz-shadow);
}

.tz-product-card.tz-out-of-stock-card {
    opacity: 0.7;
}

.tz-badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--tz-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--tz-radius-sm);
    letter-spacing: 0.04em;
    z-index: 2;
}

.tz-badge-oos {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--tz-text-muted);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--tz-radius-sm);
    z-index: 2;
}

.tz-card-image-link {
    background: var(--tz-surface-alt);
    padding: 4px;
    text-align: center;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tz-card-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.tz-card-body {
    padding: 12px 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tz-card-brand {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tz-accent);
    margin-bottom: 4px;
}

.tz-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--tz-text);
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tz-card-title:hover {
    color: var(--tz-accent);
}

.tz-card-specs {
    font-size: 11px;
    color: var(--tz-text-muted);
    margin-bottom: 4px;
    line-height: 1.5;
}

.tz-card-battery {
    font-size: 11px;
    color: var(--tz-text-muted);
    margin-bottom: 10px;
}

.tz-card-footer {
    margin-top: auto;
}

.tz-card-prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}

.tz-card-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--tz-text);
}

.tz-card-price.tz-sale-price {
    color: var(--tz-accent);
}

.tz-card-price-original {
    font-size: 13px;
    color: var(--tz-text-muted);
    text-decoration: line-through;
}

.tz-add-to-cart {
    width: 100%;
    padding: 10px 0;
    border-radius: var(--tz-radius);
    border: none;
    background: var(--tz-accent);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--tz-font);
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.02em;
}

.tz-add-to-cart:hover {
    background: var(--tz-accent-hover);
}

.tz-add-to-cart.tz-adding {
    background: var(--tz-text-muted);
    cursor: wait;
}

.tz-add-to-cart.tz-added {
    background: var(--tz-success);
}

.tz-add-to-cart.tz-out-of-stock {
    background: var(--tz-border);
    color: var(--tz-text-muted);
    cursor: not-allowed;
}

/* ─── Loading State ─── */

.tz-loading-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.tz-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--tz-border);
    border-top-color: var(--tz-accent);
    border-radius: 50%;
    animation: tz-spin 0.7s linear infinite;
    margin: 0 auto 12px;
}

@keyframes tz-spin {
    to { transform: rotate(360deg); }
}

.tz-loading-state p {
    font-size: 14px;
    color: var(--tz-text-muted);
}

/* ─── Empty State ─── */

.tz-empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.tz-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.tz-empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--tz-text);
    margin: 0 0 8px;
}

.tz-empty-state p {
    font-size: 13px;
    color: var(--tz-text-muted);
    margin: 0 0 16px;
}

.tz-btn-primary {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--tz-radius);
    border: none;
    background: var(--tz-accent);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--tz-font);
    cursor: pointer;
}

/* ─── Pagination ─── */

.tz-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.tz-page-btn {
    padding: 8px 14px;
    border-radius: var(--tz-radius-sm);
    border: 1px solid var(--tz-border);
    background: var(--tz-surface);
    color: var(--tz-text);
    font-size: 13px;
    font-family: var(--tz-font);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.tz-page-btn:hover {
    border-color: var(--tz-accent);
    color: var(--tz-accent);
}

.tz-page-btn.tz-page-active {
    background: var(--tz-accent);
    border-color: var(--tz-accent);
    color: #fff;
}

.tz-page-ellipsis {
    padding: 8px 6px;
    color: var(--tz-text-muted);
}

/* ─── Cart FAB ─── */

.tz-cart-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1A1A1A;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--tz-shadow-lg);
    z-index: 90;
    transition: all 0.2s;
}

.tz-cart-fab:hover {
    transform: scale(1.05);
}

.tz-cart-fab.tz-has-items {
    background: var(--tz-accent);
}

.tz-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: var(--tz-accent);
    font-size: 11px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ─── Cart Drawer ─── */

.tz-cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    justify-content: flex-end;
}

.tz-cart-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    cursor: pointer;
}

.tz-cart-panel {
    position: relative;
    width: 380px;
    max-width: 90vw;
    background: var(--tz-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.2);
}

.tz-cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--tz-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 800;
}

.tz-cart-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--tz-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.tz-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tz-cart-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--tz-text-muted);
    font-size: 14px;
}

.tz-cart-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--tz-border);
}

.tz-cart-item-image {
    width: 56px;
    height: 56px;
    border-radius: var(--tz-radius);
    object-fit: cover;
    background: var(--tz-surface-alt);
    flex-shrink: 0;
}

.tz-cart-item-details {
    flex: 1;
    min-width: 0;
}

.tz-cart-item-name {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.tz-cart-item-price {
    font-size: 13px;
    color: var(--tz-text-muted);
    margin-bottom: 8px;
}

.tz-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tz-cart-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--tz-border);
    border-radius: var(--tz-radius-sm);
    background: var(--tz-surface-alt);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tz-text);
    padding: 0;
}

.tz-cart-qty-value {
    width: 28px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.tz-cart-remove {
    margin-left: 8px;
    background: none;
    border: none;
    color: var(--tz-danger);
    font-size: 11px;
    cursor: pointer;
    font-family: var(--tz-font);
    padding: 0;
}

.tz-cart-footer {
    padding: 20px;
    border-top: 1px solid var(--tz-border);
}

.tz-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-weight: 700;
}

.tz-cart-total span:last-child {
    font-size: 20px;
    font-weight: 800;
}

.tz-checkout-btn {
    display: block;
    width: 100%;
    padding: 14px 0;
    border-radius: var(--tz-radius);
    background: var(--tz-accent);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    text-align: center;
    text-decoration: none;
    font-family: var(--tz-font);
    letter-spacing: 0.02em;
    transition: background 0.15s;
}

.tz-checkout-btn:hover {
    background: var(--tz-accent-hover);
    color: #fff;
}

.tz-view-cart-link {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--tz-text-muted);
    text-decoration: none;
}

.tz-view-cart-link:hover {
    color: var(--tz-accent);
}

/* ─── Mobile Filter Sheet ─── */

.tz-mobile-filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.tz-mobile-filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    cursor: pointer;
}

.tz-mobile-filter-sheet {
    position: relative;
    background: var(--tz-bg);
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.tz-mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tz-border);
    font-size: 16px;
    font-weight: 800;
}

.tz-mobile-filter-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--tz-text-muted);
    cursor: pointer;
    padding: 0;
}

.tz-mobile-filter-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.tz-mobile-filter-footer {
    padding: 12px 20px 24px;
    border-top: 1px solid var(--tz-border);
}

.tz-mobile-filter-apply {
    width: 100%;
    padding: 14px 0;
    border-radius: var(--tz-radius);
    border: none;
    background: var(--tz-accent);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    font-family: var(--tz-font);
    cursor: pointer;
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
    .tz-filters {
        display: none;
    }

    .tz-mobile-filter-btn {
        display: flex;
    }

    .tz-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tz-card-price {
        font-size: 16px;
    }

    .tz-card-specs {
        font-size: 10px;
    }

    .tz-card-battery {
        display: none;
    }

    .tz-card-body {
        padding: 10px 10px 12px;
    }

    .tz-card-image-link {
        padding: 4px;
        height: 150px;
    }

    .tz-shop-toolbar {
        padding: 12px 0;
    }

    .tz-cart-fab {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .tz-card-title {
        font-size: 12px;
    }

    .tz-card-brand {
        font-size: 9px;
    }

    .tz-add-to-cart {
        font-size: 11px;
        padding: 8px 0;
    }
}
