/* =====================================================
   PURPLE LEAF CREATION - Shop Page Styles
   ===================================================== */

.shop-page {
    background: var(--off-white);
    min-height: 100vh;
}

/* ===== BREADCRUMB ===== */
.shop-breadcrumb {
    background: var(--white);
    padding: 14px 0;
    border-bottom: 1px solid var(--grey);
}

.shop-breadcrumb .breadcrumb {
    margin: 0;
    font-size: 0.85rem;
}

.shop-breadcrumb .breadcrumb-item a {
    color: var(--grey-dark);
    transition: color var(--transition-fast);
}

.shop-breadcrumb .breadcrumb-item a:hover {
    color: var(--purple-primary);
}

.shop-breadcrumb .breadcrumb-item.active {
    color: var(--purple-primary);
    font-weight: 500;
}

.shop-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--grey-medium);
}

/* ===== SHOP HERO ===== */
.shop-hero {
    position: relative;
    min-height: 260px;
    background-image: url("/images/slider-banner-main.png");
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    display: flex;
    align-items: center;
    color: var(--white);
    padding: 50px 0;
}

.shop-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(42, 8, 51, 0.295) 0%,
        rgba(42, 8, 51, 0.63) 50%,
        rgba(45, 8, 54, 0.151) 100%
    );
}

.shop-hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    text-align: center;
    margin: 0 auto;
}

.shop-hero-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shop-hero-title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.shop-hero-subtitle {
    font-size: 0.98rem;
    font-weight: 300;
    opacity: 0.9;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== CATEGORY NAVIGATION ===== */
.shop-category-nav {
    background: var(--white);
    padding: 20px 0;
    border-bottom: 1px solid var(--grey);
    position: sticky;
    top: var(--header-height);
    z-index: 40;
}

.category-nav-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

.category-nav-scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex-shrink: 0;
    padding: 9px 20px;
    border: 1.5px solid var(--grey);
    background: var(--white);
    color: var(--text-primary);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-chip:hover {
    border-color: var(--purple-primary);
    color: var(--purple-primary);
}

.category-chip.active {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
    border-color: var(--purple-primary);
    color: var(--white);
    box-shadow: var(--shadow-purple);
}

/* ===== MAIN SHOP LAYOUT ===== */
.shop-main {
    padding: 40px 0 60px;
}

/* ===== SIDEBAR ===== */
.shop-sidebar {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--grey);
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-height) + 90px);
    max-height: calc(100vh - var(--header-height) - 110px);
    overflow-y: auto;
}

.shop-sidebar::-webkit-scrollbar {
    width: 5px;
}

.shop-sidebar::-webkit-scrollbar-thumb {
    background: var(--purple-light);
    border-radius: 3px;
}

.sidebar-header {
    display: none;
    padding: 16px 20px;
    border-bottom: 1px solid var(--grey);
    background: var(--purple-ultra-light);
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h5 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--plum-dark);
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 8px;
}

.sidebar-body {
    padding: 20px;
}

/* ===== FILTER BLOCKS ===== */
.filter-block {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--grey);
}

.filter-block:last-of-type {
    border-bottom: none;
}

.filter-title {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--plum-dark);
    margin-bottom: 14px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 4px 0;
    transition: color var(--transition-fast);
}

.filter-check:hover {
    color: var(--purple-primary);
}

.filter-check input[type="checkbox"] {
    accent-color: var(--purple-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.85rem;
}

.rating-stars i {
    color: var(--gold);
    font-size: 0.75rem;
}

/* Price Range */
.price-range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--purple-dark);
    margin-bottom: 10px;
}

.form-range {
    accent-color: var(--purple-primary);
}

.form-range::-webkit-slider-thumb {
    background: var(--purple-primary);
}

.form-range::-moz-range-thumb {
    background: var(--purple-primary);
}

/* Colors */
.filter-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--grey);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--purple-primary);
}

/* Sizes */
.filter-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.size-chip {
    padding: 6px 12px;
    border: 1.5px solid var(--grey);
    background: var(--white);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.size-chip:hover {
    border-color: var(--purple-primary);
    color: var(--purple-primary);
}

.size-chip.active {
    background: var(--purple-primary);
    border-color: var(--purple-primary);
    color: var(--white);
}

/* Filter Actions */
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.btn-apply-filters {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
    color: var(--white);
    border: none;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all var(--transition-normal);
}

.btn-apply-filters:hover {
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-purple);
}

.btn-clear-filters {
    background: transparent;
    color: var(--purple-primary);
    border: 1.5px solid var(--purple-primary);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.btn-clear-filters:hover {
    background: var(--purple-primary);
    color: var(--white);
}

/* ===== PRODUCT TOOLBAR ===== */
.product-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.results-count span {
    font-weight: 600;
    color: var(--purple-dark);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-filter-btn {
    background: var(--purple-primary);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-filter-btn:hover {
    background: var(--purple-dark);
}

.view-toggle {
    display: inline-flex;
    border: 1px solid var(--grey);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.view-btn {
    background: var(--white);
    border: none;
    padding: 8px 12px;
    color: var(--grey-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.view-btn:hover {
    color: var(--purple-primary);
}

.view-btn.active {
    background: var(--purple-primary);
    color: var(--white);
}

.sort-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid var(--grey);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--white);
    cursor: pointer;
    min-width: 160px;
    outline: none;
}

.sort-select:focus {
    border-color: var(--purple-primary);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Shop product card - reusing homepage styles but slightly optimized */
.shop-product-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 1px solid var(--grey);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.shop-product-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: transparent;
    transform: translateY(-4px);
}

.shop-product-card .product-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--grey-light);
}

.shop-product-card .product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.shop-product-card:hover .product-image {
    transform: scale(1.06);
}

.shop-product-card .product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--purple-primary);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    z-index: 2;
}

.shop-product-card .product-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    z-index: 2;
}

.shop-product-card .wishlist-btn {
    position: absolute;
    top: 38px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-8px);
    transition: all var(--transition-normal);
    z-index: 3;
    box-shadow: var(--shadow-sm);
}

.shop-product-card:hover .wishlist-btn {
    opacity: 1;
    transform: translateY(0);
}

.shop-product-card .wishlist-btn:hover {
    color: var(--danger);
}

.shop-product-card .wishlist-btn.active {
    color: var(--danger);
}

.shop-product-card .out-of-stock-badge {
    position: absolute;
    inset: 0;
    background: rgba(45, 45, 45, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 4;
    backdrop-filter: blur(2px);
}

.shop-product-card .product-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.shop-product-card .product-category {
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--grey-medium);
    margin-bottom: 4px;
}

.shop-product-card .product-name {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.shop-product-card .product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.shop-product-card .stars {
    display: flex;
    gap: 1px;
}

.shop-product-card .stars i {
    color: var(--gold);
    font-size: 0.7rem;
}

.shop-product-card .review-count {
    font-size: 0.7rem;
    color: var(--grey-medium);
}

.shop-product-card .product-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.shop-product-card .current-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--purple-dark);
}

.shop-product-card .old-price {
    font-size: 0.8rem;
    color: var(--grey-medium);
    text-decoration: line-through;
}

.shop-product-card .add-to-cart-btn {
    margin-top: auto;
    width: 100%;
    padding: 9px 14px;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.shop-product-card .add-to-cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-purple);
}

.shop-product-card .add-to-cart-btn:disabled {
    background: var(--grey-medium);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== LIST VIEW ===== */
.product-grid.list-view {
    grid-template-columns: 1fr;
    gap: 16px;
}

.product-grid.list-view .shop-product-card {
    flex-direction: row;
    align-items: stretch;
}

.product-grid.list-view .product-image-wrapper {
    width: 240px;
    flex-shrink: 0;
    aspect-ratio: 1;
}

.product-grid.list-view .product-info {
    padding: 20px;
}

.product-grid.list-view .product-name {
    font-size: 1rem;
    min-height: auto;
}

.product-grid.list-view .add-to-cart-btn {
    max-width: 200px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    background: var(--white);
    border: 1px solid var(--grey);
    border-radius: var(--radius-md);
    padding: 60px 30px;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--purple-ultra-light);
    color: var(--purple-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--plum-dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ===== PAGINATION ===== */
.shop-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination-list {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--grey);
    background: var(--white);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--purple-primary);
    color: var(--purple-primary);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
    border-color: var(--purple-primary);
    color: var(--white);
    box-shadow: var(--shadow-purple);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== SHOP PROMO ===== */
.shop-promo {
    padding: 0;
}

.shop-promo .promo-banner {
    min-height: 320px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}

.shop-promo .promo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(61, 16, 73, 0.85), rgba(123, 45, 142, 0.7));
}

.shop-promo .promo-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
    color: var(--white);
    padding: 40px 0;
}

.shop-promo .promo-tag {
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--purple-light);
    margin-bottom: 12px;
    display: inline-block;
}

.shop-promo .promo-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.shop-promo .promo-text {
    font-size: 0.98rem;
    opacity: 0.9;
    margin-bottom: 24px;
}

/* ===== SIDEBAR BACKDROP (Mobile) ===== */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1055;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ===== RESPONSIVE ===== */

/* Tablet Large */
@media (max-width: 1199.98px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Tablet */
@media (max-width: 991.98px) {
    .shop-sidebar-col {
        display: none;
    }

    .shop-sidebar-col.active {
        display: block;
    }

    .shop-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1060;
        border-radius: 0;
        border: none;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        box-shadow: var(--shadow-xl);
    }

    .shop-sidebar.active {
        transform: translateX(0);
    }

    .shop-sidebar-col.active .shop-sidebar {
        transform: translateX(0);
    }

    .sidebar-header {
        display: flex;
    }

    .shop-hero-title {
        font-size: 2.1rem;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Small */
@media (max-width: 767.98px) {
    .shop-hero {
        min-height: 200px;
        padding: 30px 0;
    }

    .shop-hero-title {
        font-size: 1.7rem;
    }

    .shop-hero-subtitle {
        font-size: 0.88rem;
    }

    .shop-category-nav {
        padding: 14px 0;
        position: relative;
        top: 0;
    }

    .category-chip {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .product-toolbar {
        padding: 12px;
    }

    .results-count {
        font-size: 0.78rem;
        width: 100%;
        order: -1;
    }

    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .sort-select {
        min-width: 130px;
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .shop-product-card .product-info {
        padding: 12px;
    }

    .shop-product-card .product-name {
        font-size: 0.82rem;
    }

    .shop-product-card .current-price {
        font-size: 0.95rem;
    }

    .shop-product-card .old-price {
        font-size: 0.72rem;
    }

    .shop-product-card .add-to-cart-btn {
        font-size: 0.7rem;
        padding: 8px 10px;
    }

    /* Force list view to grid on mobile */
    .product-grid.list-view {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-grid.list-view .shop-product-card {
        flex-direction: column;
    }

    .product-grid.list-view .product-image-wrapper {
        width: 100%;
    }

    .shop-promo .promo-title {
        font-size: 1.6rem;
    }
}

/* Mobile Small */
@media (max-width: 575.98px) {
    .shop-main {
        padding: 24px 0 40px;
    }

    .shop-hero-title {
        font-size: 1.5rem;
    }

    .product-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-btn {
        min-width: 34px;
        height: 34px;
        font-size: 0.78rem;
        padding: 0 8px;
    }
}

/* Very Small */
@media (max-width: 375px) {
    .product-grid {
        gap: 10px;
    }

    .shop-product-card .product-info {
        padding: 10px;
    }

    .shop-product-card .add-to-cart-btn {
        font-size: 0.65rem;
        padding: 7px 8px;
    }

    .category-chip {
        padding: 7px 14px;
        font-size: 0.75rem;
    }
}

/* Body scroll lock when sidebar open on mobile */
body.sidebar-open {
    overflow: hidden;
}
/* Wrapper around EJS product-card partial */
.product-grid .product-item {
    min-width: 0;
}

.product-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.product-sofa-type {
    font-size: 0.7rem;
    color: var(--purple-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
