/* ============================================================
   SHOP PAGE — Minimalist & Mobile-First Design
   Brand color: #ff4800 (orange)
   ============================================================ */

:root {
    --brand:        #ff4800;
    --brand-dark:   #e06010;
    --brand-light:  #fff7ed;
    --text-dark:    #111827;
    --text-mid:     #374151;
    --text-muted:   #9ca3af;
    --border:       #e5e7eb;
    --bg-page:      #f4f5f7;
    --bg-white:     #ffffff;
    --radius:       10px;
    --radius-sm:    7px;
    --shadow-sm:    0 1px 4px rgba(0,0,0,0.07);
    --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
    --transition:   0.2s ease;
    --font-base:    16px;
}

/* ===== Base Font Size ===== */
.shop-header,
.shop-search-bar,
.mobile-filter-bar,
.shop-main {
    font-size: var(--font-base);
}

/* ===== Page Header ===== */
.shop-header {
    background: linear-gradient(135deg, #ff4800 0%, #fb923c 100%);
    padding: 32px 0 24px;
}
.shop-header-title {
    color: #fff;
    font-size: 2.1rem;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.shop-header-sub {
    color: rgba(255,255,255,0.88);
    font-size: 1rem;
    margin: 0;
}

/* ===== Search Bar (below header) ===== */
.shop-search-bar {
    background: #fff;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.shop-search-wrap {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 0 20px;
    height: 52px;
    gap: 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.shop-search-wrap:focus-within {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}
.shop-search-icon { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }
.shop-search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 16px;
    color: var(--text-dark);
}
.shop-search-input::placeholder { color: #b0b7c3; }

/* ===== Mobile Filter Bar ===== */
.mobile-filter-bar {
    display: none;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 11px 0;
}
.mobile-filter-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 9px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.mobile-filter-btn:hover { background: var(--brand-dark); }
.mobile-results-count {
    display: none;
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 600;
}

/* ===== Mobile Overlay ===== */
.filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
    backdrop-filter: blur(2px);
}
.filter-overlay.active { display: block; }

/* ===== Main Layout ===== */
.shop-main { padding: 26px 0 60px; background: var(--bg-page); min-height: 60vh; }
.shop-layout { display: flex; gap: 22px; align-items: flex-start; }

/* ===== Sidebar ===== */
.shop-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 16px;
}
.sidebar-header-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 18px;
    color: var(--text-dark);
}
.sidebar-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: color var(--transition);
}
.sidebar-close-btn:hover { color: var(--brand); }

.sidebar-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.sidebar-card-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-dark);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.sidebar-card-title i { color: var(--brand); font-size: 14px; }
.sidebar-card-header .sidebar-card-title { margin-bottom: 0; }

.sidebar-search-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 5px 9px;
    transition: all var(--transition);
}
.sidebar-search-btn:hover { border-color: var(--brand); color: var(--brand); }

.cat-search-wrap { margin-bottom: 10px; }
.cat-search-wrap input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
    box-sizing: border-box;
}
.cat-search-wrap input:focus { border-color: var(--brand); }

/* ===== Category List ===== */
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 7px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}
.cat-item:hover { background: var(--brand-light); }
.cat-item label { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; margin: 0; }
.cat-item input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--brand);
    cursor: pointer; flex-shrink: 0;
}
.cat-name { font-size: 15px; color: var(--text-mid); font-weight: 400; line-height: 1.3; }
.cat-item input[type="checkbox"]:checked + .cat-name { color: var(--brand); font-weight: 600; }
.cat-count {
    font-size: 12px; color: var(--text-muted);
    background: #f3f4f6; border-radius: 50px;
    padding: 2px 9px; font-weight: 600;
    white-space: nowrap; min-width: 26px; text-align: center;
}

.see-more-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
    justify-content: center;
    transition: all var(--transition);
}
.see-more-btn:hover { background: var(--brand-light); border-color: var(--brand); }

/* ===== Sort Select ===== */
.sidebar-select {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 15px;
    color: var(--text-mid);
    background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
}
.sidebar-select:focus { border-color: var(--brand); }

/* ===== Price Range ===== */
.price-inputs { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.price-inputs input {
    flex: 1; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 9px 10px; font-size: 14px; outline: none;
    transition: border-color var(--transition); min-width: 0; text-align: center;
}
.price-inputs input:focus { border-color: var(--brand); }
.price-dash { color: var(--text-muted); font-size: 15px; flex-shrink: 0; }

.price-apply-btn {
    width: 100%; background: var(--brand); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 11px 0; font-size: 15px;
    font-weight: 700; cursor: pointer; transition: background var(--transition);
}
.price-apply-btn:hover { background: var(--brand-dark); }

/* ===== Results Bar ===== */
.results-bar { margin-bottom: 18px; }
.results-bar span {
    display: inline-block;
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0;
}

/* ===== Products Grid =====
   Bootstrap .row + col-* overrides for 4-per-row layout
   ============================================================ */
.product-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: -8px !important;
    margin-right: -8px !important;
}

/* Each card column: 4 per row on desktop */
.product-grid > .col-6,
.product-grid > .col-sm-6,
.product-grid > .col-md-4,
.product-grid > .col-md-3,
.product-grid > .col-lg-3,
.product-grid > [class*="col-"] {
    width: 25% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    margin-bottom: 16px !important;
    flex: 0 0 25% !important;
    max-width: 25% !important;
    box-sizing: border-box !important;
}

/* ===== Product Card (allpro-card) ===== */
.allpro-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
    height: 100%;
}
.allpro-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #fde8d4;
}
.allpro-img-wrap {
    position: relative; display: block; width: 100%;
    padding-top: 100%; overflow: hidden; background: #f8f9fa;
}
.allpro-img-wrap img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.35s ease;
}
.allpro-card:hover .allpro-img-wrap img { transform: scale(1.06); }

/* Badge: NEW (top-left), discount % (top-right) */
.allpro-badge-new {
    position: absolute; top: 8px; left: 8px;
    background: #10b981; color: #fff;
    font-size: 11px; font-weight: 800;
    padding: 3px 10px; border-radius: 50px; z-index: 2;
}
.allpro-badge {
    position: absolute; top: 8px; right: 8px;
    background: #1a1a1a; color: #fff;
    font-size: 11px; font-weight: 800;
    padding: 3px 10px; border-radius: 50px; z-index: 2;
}

/* Info section: price ABOVE name */
.allpro-info {
    padding: 13px 13px 7px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

/* Price row — shown FIRST (above name) */
.allpro-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    order: 1;
}
.allpro-price b { color: var(--brand); font-size: 17px; font-weight: 800; }
.allpro-price del { color: var(--text-muted); font-size: 13px; text-decoration: line-through; }

/* Name — shown SECOND (below price) */
.allpro-name {
    font-size: 14px;
    color: var(--text-mid);
    font-weight: 400;
    text-decoration: none;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition);
    order: 2;
}
.allpro-name:hover { color: var(--brand); }

.allpro-cart-btn,
.allpro-card .addcartbutton {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    margin: 8px 13px 13px; background: var(--brand); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 10px 0; font-size: 14px; font-weight: 700;
    text-decoration: none; cursor: pointer; width: calc(100% - 26px);
    transition: background var(--transition); text-transform: none; box-shadow: none;
    order: 3;
}
.allpro-cart-btn:hover,
.allpro-card .addcartbutton:hover { background: var(--brand-dark); color: #fff; }
.allpro-cart-btn--out {
    background: var(--border) !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}
.allpro-cart-btn--out i {
    color: #6b7280 !important;
}

/* ===== Generic Product Card (used in related products etc.) ===== */
.product-card {
    background: var(--bg-white);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex; flex-direction: column;
    height: 100%;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #fde8d4; }
.product-card > a { text-decoration: none; color: inherit; flex: 1; display: flex; flex-direction: column; }
.product-img-wrap {
    position: relative; width: 100%; padding-top: 100%;
    overflow: hidden; background: #f8f9fa;
}
.product-img-wrap img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s;
}
.product-card:hover .product-img-wrap img { transform: scale(1.06); }
.product-badges {
    position: absolute; top: 8px; left: 0; right: 0;
    display: flex; justify-content: space-between; padding: 0 8px; pointer-events: none;
}
.badge-discount {
    background: #1a1a1a; color: #fff; font-size: 11px; font-weight: 800;
    padding: 3px 10px; border-radius: 50px;
}
.badge-new {
    background: #10b981; color: #fff; font-size: 11px; font-weight: 800;
    padding: 3px 10px; border-radius: 50px;
}
.badge-hot {
    background: #ef4444; color: #fff; font-size: 11px; font-weight: 800;
    padding: 3px 10px; border-radius: 50px;
}
.no-img-placeholder {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; background: #f0f2f5; color: #d1d5db; font-size: 2.5rem;
}

/* Product info: price first, name second */
.product-info {
    padding: 13px 13px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.product-pricing {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    order: 1;
}
.current-price { font-size: 17px; font-weight: 800; color: var(--brand); }
.old-price { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.product-name {
    font-size: 14px; color: var(--text-mid); font-weight: 400;
    margin: 0; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    order: 2;
}
.add-to-cart-btn {
    margin: 8px 13px 13px; background: var(--brand); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 10px 0; font-size: 14px; font-weight: 700;
    cursor: pointer; width: calc(100% - 26px);
    transition: background var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    text-decoration: none;
}
.add-to-cart-btn:hover { background: var(--brand-dark); color: #fff; }

/* ===== Loading / Empty ===== */
.loading-spinner {
    display: flex; flex-direction: column; align-items: center;
    padding: 44px 0; gap: 14px; color: var(--text-muted); font-size: 15px;
}
.spinner {
    width: 36px; height: 36px;
    border: 3px solid #f3f4f6;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-more-text {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 28px; color: var(--text-muted); font-size: 14px;
}
.no-more-text i { color: #10b981; }

.empty-msg { text-align: center; padding: 70px 20px; color: var(--text-muted); width: 100%; }
.empty-msg i { font-size: 3.5rem; margin-bottom: 16px; display: block; color: #d1d5db; }
.empty-msg p { font-size: 16px; }

/* ===== Related Products Grid ===== */
.related-product-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: -8px !important;
    margin-right: -8px !important;
}
.related-product-grid > [class*="col-"] {
    width: 25% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    margin-bottom: 16px !important;
    flex: 0 0 25% !important;
    max-width: 25% !important;
    box-sizing: border-box !important;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .product-grid > [class*="col-"] {
        width: 33.333% !important;
        flex: 0 0 33.333% !important;
        max-width: 33.333% !important;
    }
    .related-product-grid > [class*="col-"] {
        width: 33.333% !important;
        flex: 0 0 33.333% !important;
        max-width: 33.333% !important;
    }
    .shop-sidebar { width: 220px; }
}
@media (max-width: 900px) {
    .product-grid > [class*="col-"] {
        width: 33.333% !important;
        flex: 0 0 33.333% !important;
        max-width: 33.333% !important;
    }
}
@media (max-width: 768px) {
    .shop-header { padding: 24px 0 20px; }
    .shop-header-title { font-size: 1.6rem; }
    .shop-search-bar { padding: 12px 0; }

    .mobile-filter-bar { display: block; }
    .shop-main { padding: 16px 0 50px; }
    .shop-layout { display: block; }

    .shop-sidebar {
        position: fixed;
        top: 0; right: -100%;
        width: 310px; max-width: 88vw;
        height: 100vh;
        background: var(--bg-white);
        z-index: 999;
        border-radius: 0;
        flex-direction: column;
        gap: 0;
        overflow-y: auto;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        padding: 0;
    }
    .shop-sidebar.open { right: 0; box-shadow: -4px 0 24px rgba(0,0,0,0.15); }
    .sidebar-header-mobile { display: flex; }
    .sidebar-card {
        border-radius: 0; border-left: none; border-right: none;
        border-top: none; box-shadow: none;
        border-bottom: 1px solid var(--border); padding: 16px 20px;
    }

    .product-grid > [class*="col-"] {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 10px !important;
    }
    .related-product-grid > [class*="col-"] {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 10px !important;
    }
}
@media (max-width: 480px) {
    .product-grid > [class*="col-"] {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 8px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    .related-product-grid > [class*="col-"] {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 8px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    .allpro-cart-btn,
    .allpro-card .addcartbutton,
    .add-to-cart-btn {
        margin: 6px 8px 8px;
        width: calc(100% - 16px);
        font-size: 13px; padding: 9px 0;
    }
}
