/* ============================================================
   SHOP PAGE – PROFESSIONAL UI
   Prefix: shop- for all classes to avoid conflicts
   ============================================================ */
:root {
    --shop-brown: #502110;
    --shop-brown-dark: #35150a;
    --shop-red: #c81e1e;
    --shop-red-dark: #a11717;
    --shop-border: #e8e2df;
    --shop-text: #222;
    --shop-muted: #777;
    --shop-bg: #faf9f8;
    --shop-sidebar-width: 270px;
    --shop-card-gap: 0;
}

.shop-page {
    display: flex;
    gap: 28px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 36px 20px;
    background: #fff;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- SIDEBAR ---------- */
.shop-sidebar {
    flex: 0 0 var(--shop-sidebar-width);
    max-width: var(--shop-sidebar-width);
    position: sticky;
    top: 20px;
    align-self: flex-start;
    transition: transform .35s ease, opacity .35s ease;
}

.shop-sidebar-inner {
    background: #fff;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    padding: 0;
    box-shadow: 0 2px 16px rgba(80, 33, 16, .05);
    overflow: hidden;
}

.shop-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 2px solid var(--shop-border);
    background: #fdfcfb;
}

.shop-sidebar-heading {
    font-size: 14px;
    font-weight: 500;
    color: var(--shop-brown);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.shop-sidebar-close {
    display: none;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background-color: #502110;
    color: #ffff;
    font-size: 18px;
    cursor: pointer;
    transition: 2s all;
}

.shop-sidebar-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.shop-sidebar-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.shop-sidebar-body::-webkit-scrollbar-thumb {
    background: #d9d3ce;
    border-radius: 10px;
}

/* ---------- SEARCH BAR ---------- */
.shop-search-wrap {
    position: relative;
    margin-bottom: 16px;
}

.shop-search-wrap i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--shop-muted);
    font-size: 16px;
    pointer-events: none;
    transition: color .2s;
}

.shop-search-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1px solid var(--shop-border);
    border-radius: 5px;
    font-size: 13px;
    color: var(--shop-text);
    background: #faf9f8;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.shop-search-input::placeholder {
    color: #aaa;
    font-size: 12.5px;
}

.shop-search-input:focus {
    border-color: var(--shop-brown);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(80, 33, 16, .08);
}

.shop-search-wrap:focus-within i {
    color: var(--shop-brown);
}

/* ---------- APPLY FILTER BUTTON ---------- */
.shop-apply-wrap {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 2px solid var(--shop-border);
}

.shop-btn-apply {
    width: 100%;
    padding: 11px 16px;
    background: var(--shop-brown);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.shop-btn-apply:hover {
    background: var(--shop-brown-dark);
    box-shadow: 0 4px 14px rgba(80, 33, 16, .25);
}

.shop-btn-apply:active {
    transform: scale(.98);
}

.shop-btn-apply i {
    font-size: 15px;
}

/* ---------- FILTER GROUPS ---------- */
.shop-filter-group {
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid #f0ece9;
}

.shop-filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.shop-filter-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--shop-brown);
    text-transform: uppercase;
    letter-spacing: .9px;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ---------- FILTER LIST ---------- */
.shop-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shop-filter-list li {
    margin-bottom: 2px;
}

.shop-filter-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 5px;
    color: #555;
    font-size: 14px;
    text-decoration: none;
    transition: background .18s, color .18s, padding-left .18s;
    position: relative;
}

.shop-filter-list a:hover,
.shop-filter-list a.is-active {
    background: #faf7f5;
    color: var(--shop-brown);
    padding-left: 14px;
}

.shop-filter-list a:hover::before,
.shop-filter-list a.is-active::before {
    height: 55%;
}

.shop-filter-list a.is-active {
    font-weight: 600;
}

.shop-filter-list .shop-count {
    font-size: 11.5px;
    color: var(--shop-muted);
    background: #f3f0ee;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
    transition: background .18s, color .18s;
    flex-shrink: 0;
}

.shop-filter-list a:hover .shop-count,
.shop-filter-list a.is-active .shop-count {
    background: var(--shop-brown);
    color: #fff;
}

/* ---------- BRANDS LIST (checkbox style) ---------- */
.shop-brand-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d9d3ce transparent;
    padding-right: 4px;
}

.shop-brand-list::-webkit-scrollbar {
    width: 4px;
}

.shop-brand-list::-webkit-scrollbar-thumb {
    background: #d9d3ce;
    border-radius: 10px;
}

.shop-brand-list li {
    margin-bottom: 2px;
}

.shop-brand-list label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: background .18s, color .18s;
    user-select: none;
}

.shop-brand-list label:hover {
    background: #faf7f5;
    color: var(--shop-brown);
}

.shop-brand-list input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #cfc7c2;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: border-color .18s, background .18s;
}

.shop-brand-list input[type="checkbox"]:checked {
    background: var(--shop-brown);
    border-color: var(--shop-brown);
}

.shop-brand-list input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1.5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.shop-brand-list input[type="checkbox"]:hover {
    border-color: var(--shop-brown);
}

.shop-brand-list .shop-brand-count {
    margin-left: auto;
    font-size: 10.5px;
    color: var(--shop-muted);
    flex-shrink: 0;
}

/* ---------- PRICE RANGE ---------- */
.shop-price-range {
    padding: 0 2px;
}

.shop-price-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.shop-price-inputs input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--shop-text);
    background: #faf9f8;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -moz-appearance: textfield;
}

.shop-price-inputs input::-webkit-outer-spin-button,
.shop-price-inputs input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.shop-price-inputs input:focus {
    border-color: var(--shop-brown);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(80, 33, 16, .08);
}

.shop-price-inputs span {
    color: var(--shop-muted);
    font-size: 12px;
    flex-shrink: 0;
}

/* ---------- MAIN CONTENT ---------- */
.shop-main {
    flex: 1;
    min-width: 0;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--shop-border);
}

.shop-header-left h1 {
    margin: 0;
    font-size: 33px;
    font-weight: 500;
    color: var(--shop-brown);
    letter-spacing: .3px;
    line-height: 1.25;
}

.shop-header-left p {
    margin: 4px 0 0;
    font-size: 13.5px;
    color: var(--shop-muted);
    line-height: 1.5;
}

.shop-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.shop-sort-select {
    padding: 9px 14px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--shop-text);
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    min-width: 180px;
}

.shop-sort-select:focus {
    border-color: var(--shop-brown);
    box-shadow: 0 0 0 3px rgba(80, 33, 16, .08);
}

/* ---------- PRODUCT GRID ---------- */
.shop-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--shop-border);
    border-left: 1px solid var(--shop-border);
}

.shop-product-card {
    position: relative;
    min-width: 0;
    background: #fff;
    border-right: 1px solid var(--shop-border);
    border-bottom: 1px solid var(--shop-border);
    overflow: hidden;
    transition: box-shadow .3s ease;
}

.shop-product-card:hover {
    z-index: 2;
    box-shadow: 0 10px 28px rgba(80, 33, 16, .12);
}

.shop-product-image-wrap {
    position: relative;
    width: calc(100% - 16px);
    margin: 8px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f7f5f3;
}

.shop-product-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .55s cubic-bezier(.2, .7, .2, 1), opacity .35s ease;
}

.shop-product-image-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease, visibility .4s ease, transform .55s cubic-bezier(.2, .7, .2, 1);
    z-index: 2;
}

.shop-product-card:hover .shop-product-image-hover {
    opacity: 1;
    visibility: visible;
}

.shop-product-card:hover .shop-product-image {
    opacity: 0;
}

.shop-product-card:hover .shop-product-image,
.shop-product-card:hover .shop-product-image-hover {
    transform: scale(1.045);
}

.shop-product-info {
    padding: 0 12px 16px;
    text-align: center;
}

.shop-product-name {
    margin: 0;
    color: var(--shop-text);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .2px;
    text-transform: uppercase;
    line-height: 1.4em;
    min-height: 1.4em;
}

.shop-product-name a {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    color: inherit;
}

.shop-product-inspired {
    min-height: 32px;
    margin: 8px 0 6px;
    color: var(--shop-muted);
    font-size: 10.5px;
    line-height: 1.5;
    font-weight: 400;
}

.shop-product-inspired strong {
    color: #555;
    font-weight: 500;
}

.shop-product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.shop-old-price {
    color: #b7b7b7;
    font-size: 12px;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.shop-current-price {
    color: var(--shop-brown);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .1px;
}

.shop-product-action {
    position: absolute;
    left: 50%;
    bottom: 68px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .12);
    transform: translate(-50%, 12px);
    opacity: 0;
    visibility: hidden;
    white-space: nowrap;
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
}

.shop-product-card:hover .shop-product-action {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.shop-product-action .shop-action-btn {
    width: 44px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #222;
    background: #fff;
    border-right: 1px solid #f0ece9;
    text-decoration: none;
    font-size: 17px;
    transition: color .2s ease, background .2s ease;
}

.shop-product-action .shop-action-btn:last-child {
    border-right: none;
}

.shop-product-action .shop-action-btn:hover {
    color: var(--shop-brown);
    background: #faf7f5;
}

.shop-product-action .shop-action-btn i {
    font-size: 17px;
}

/* ---------- MOBILE FILTER OVERLAY ---------- */
.shop-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

.shop-sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ---------- MOBILE FILTER TOGGLE ---------- */
.shop-mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: var(--shop-brown);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}

.shop-mobile-filter-toggle:hover {
    background: var(--shop-brown-dark);
}

.shop-mobile-filter-toggle i {
    font-size: 16px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1300px) {
    .shop-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .shop-page {
        flex-direction: column;
        padding: 20px 16px;
        gap: 0;
    }

    .shop-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 999;
        width: 300px;
        max-width: 88vw;
        flex: none;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .35s ease, visibility .35s ease;
        align-self: auto;
    }

    .shop-sidebar.is-open {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .shop-sidebar-inner {
        border-radius: 0 16px 16px 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        box-shadow: 4px 0 30px rgba(0, 0, 0, .15);
    }

    .shop-sidebar-close {
        display: inline-flex;
    }

    .shop-sidebar-body {
        max-height: calc(100vh - 70px);
        flex: 1;
    }

    .shop-sidebar-overlay {
        display: block;
    }

    .shop-mobile-filter-toggle {
        display: inline-flex;
    }

    .shop-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-header {
        margin-bottom: 20px;
    }

    .shop-header-left h1 {
        font-size: 20px;
    }

    .shop-header-left p {
        font-size: 12.5px;
    }
}

@media (max-width: 575px) {
    .shop-page {
        padding: 12px 0;
    }

    .shop-header {
        padding: 0 12px 16px;
        margin-bottom: 16px;
        gap: 12px;
    }

    .shop-header-left h1 {
        font-size: 17px;
    }

    .shop-header-left p {
        font-size: 11.5px;
    }

    .shop-header-right {
        width: 100%;
        gap: 8px;
    }

    .shop-sort-select {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 8px 10px;
    }

    .shop-mobile-filter-toggle {
        padding: 8px 12px;
        font-size: 11.5px;
    }

    .shop-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-product-image-wrap {
        width: calc(100% - 10px);
        margin: 5px;
    }

    .shop-product-info {
        padding: 0 7px 12px;
    }

    .shop-product-name {
        font-size: 11.5px;
    }

    .shop-product-inspired {
        min-height: 28px;
        margin: 6px 0 5px;
        font-size: 9px;
    }

    .shop-old-price {
        font-size: 10px;
    }

    .shop-current-price {
        font-size: 12.5px;
    }

    .shop-product-action {
        display: none;
    }
}

@media (max-width: 400px) {
    .shop-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-product-name {
        font-size: 10.5px;
    }

    .shop-current-price {
        font-size: 11.5px;
    }
}

/* Body scroll lock when sidebar open */
body.shop-sidebar-open {
    overflow: hidden;
}