/**
 * Shop & Archive Pages — Eshanarya
 * @package Eshanarya
 */

/* ============================================
   SHOP PAGE HEADER
   ============================================ */

.ea-shop-header {
    background: var(--ea-cream);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    padding: 28px 0 32px;
}

.ea-shop-page-title {
    margin-top: 12px;
}

.ea-shop-page-title .ea-page-title {
    font-family: var(--ea-font-heading);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 600;
    color: var(--ea-black);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.ea-shop-page-title .ea-page-subtitle {
    color: #777;
    font-size: 0.98rem;
    margin: 0;
    max-width: 520px;
}

/* ============================================
   WC MAIN WRAPPER
   ============================================ */

.ea-wc-main-wrapper {
    padding: 40px 0 64px;
    background: #fff;
    min-height: 60vh;
}

.ea-wc-main-wrapper > .container {
    max-width: 1320px;
    padding-left: 24px;
    padding-right: 24px;
}

/* ============================================
   SHOP SIDEBAR COLUMN
   ============================================ */

.ea-shop-sidebar-col {
    padding-right: 28px;
}

.ea-shop-sidebar {
    position: sticky;
    top: 100px;
}

/* ============================================
   SIDEBAR WIDGET BASE
   ============================================ */

.ea-sidebar-widget {
    background: #fff;
    border: 1px solid #ede8df;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.ea-sidebar-widget-title {
    font-family: var(--ea-font-body);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ea-black);
    padding: 14px 18px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0ebe0;
    background: #fdfaf6;
}

.ea-sidebar-widget-title i {
    color: var(--ea-gold);
    font-size: 1rem;
}

.ea-sidebar-widget-body {
    padding: 6px 0;
}

/* ============================================
   CATEGORY LIST
   ============================================ */

.ea-sidebar-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ea-sidebar-cat-list li {
    border-bottom: 1px solid #f8f4ef;
}

.ea-sidebar-cat-list li:last-child {
    border-bottom: none;
}

.ea-sidebar-cat-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s, background 0.2s;
}

.ea-sidebar-cat-list li a:hover {
    color: var(--ea-gold);
    background: #fffbf2;
}

.ea-sidebar-cat-list li.ea-cat-active a {
    color: var(--ea-gold);
    background: #fffbf2;
    font-weight: 600;
}

.ea-sidebar-cat-list li a .bi {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    color: var(--ea-gold);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.ea-sidebar-cat-list li a:hover .bi,
.ea-sidebar-cat-list li.ea-cat-active a .bi {
    opacity: 1;
}

.ea-cat-name {
    flex: 1;
}

.ea-cat-count {
    background: #f0ebe0;
    color: #888;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.ea-sidebar-cat-list li.ea-cat-active .ea-cat-count {
    background: var(--ea-gold);
    color: #fff;
}

/* ============================================
   ACTIVE FILTERS BANNER
   ============================================ */

.ea-active-filters {
    background: #fffbf0;
    border: 1px solid #f0e0a0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.ea-active-filters-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 10px;
}

.ea-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ea-gold);
    color: #fff;
    font-size: 0.79rem;
    font-weight: 600;
    padding: 4px 10px 4px 12px;
    border-radius: 20px;
}

.ea-filter-tag-remove {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s;
}

.ea-filter-tag-remove:hover {
    color: #fff;
}

.ea-clear-all-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.82rem;
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.ea-clear-all-link:hover {
    color: var(--ea-black);
}

/* ============================================
   PRICE RANGE SLIDER
   ============================================ */

.ea-sidebar-widget-body > .ea-price-filter-form {
    padding: 18px 18px 20px;
}

.ea-price-slider {
    position: relative;
    height: 24px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.ea-price-slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: #e8e0d0;
    border-radius: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.ea-price-slider-range {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--ea-gold);
    border-radius: 4px;
}

.ea-price-thumb {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    width: 100%;
    height: 4px;
    background: transparent;
    pointer-events: none;
    z-index: 3;
    outline: none;
    cursor: default;
}

.ea-price-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--ea-gold);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.35);
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ea-price-thumb::-webkit-slider-thumb:hover,
.ea-price-thumb::-webkit-slider-thumb:active {
    transform: scale(1.2);
    box-shadow: 0 3px 14px rgba(201, 168, 76, 0.55);
}

.ea-price-thumb::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--ea-gold);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.35);
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.15s ease;
}

.ea-price-thumb::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* z-index: make the higher thumb always on top */
#ea-thumb-max { z-index: 4; }

.ea-price-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 16px;
}

.ea-price-val {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ea-black);
    font-family: var(--ea-font-body);
}

.ea-price-dash {
    color: #ccc;
    font-size: 1rem;
}

.ea-price-apply-btn {
    width: 100%;
    background: var(--ea-black);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.25s ease;
    font-family: var(--ea-font-body);
}

.ea-price-apply-btn:hover {
    background: var(--ea-gold);
}

/* ============================================
   SHOP TOOLBAR
   ============================================ */

.ea-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px;
    background: #fdfaf6;
    border: 1px solid #ede8df;
    border-radius: 10px;
    margin-bottom: 28px;
}

.ea-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ea-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ea-result-count {
    font-size: 0.87rem;
    color: #888;
    margin: 0;
}

.ea-result-count strong {
    color: var(--ea-black);
    font-weight: 600;
}

/* Mobile Filter Button */
.ea-mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ea-black);
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 6px 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    font-family: var(--ea-font-body);
}

.ea-mobile-filter-btn:hover {
    border-color: var(--ea-gold);
    color: var(--ea-gold-dark);
}

/* Ordering Select */
.ea-ordering-form {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ea-orderby-select {
    -webkit-appearance: none;
    appearance: none;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 7px 34px 7px 14px;
    font-size: 0.85rem;
    color: var(--ea-black);
    cursor: pointer;
    font-family: var(--ea-font-body);
    transition: border-color 0.2s;
    outline: none;
}

.ea-orderby-select:focus,
.ea-orderby-select:hover {
    border-color: var(--ea-gold);
}

.ea-ordering-form .ea-select-arrow {
    position: absolute;
    right: 11px;
    font-size: 0.68rem;
    color: #999;
    pointer-events: none;
}

/* WC fallback ordering */
.woocommerce-ordering {
    margin: 0;
}

.woocommerce-ordering select {
    -webkit-appearance: none;
    appearance: none;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 7px 32px 7px 14px;
    font-size: 0.85rem;
    font-family: var(--ea-font-body);
    transition: border-color 0.2s;
    outline: none;
}

.woocommerce-ordering select:hover {
    border-color: var(--ea-gold);
}

/* ============================================
   PRODUCT GRID
   ============================================ */

.woocommerce .ea-shop-grid.products,
ul.products.ea-shop-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 24px;
    clear: both;
    align-items: stretch;
}

.ea-shop-main-col-wide .ea-shop-grid.products,
.ea-shop-main-col-wide ul.products.ea-shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.woocommerce .ea-shop-grid.products::before,
ul.products.ea-shop-grid::before,
.woocommerce .ea-shop-grid.products::after,
ul.products.ea-shop-grid::after {
    display: none !important;
    content: none !important;
}

.woocommerce .ea-shop-grid.products li.product.ea-product-item,
ul.products.ea-shop-grid li.product.ea-product-item {
    float: none !important;
    clear: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    display: block !important;
}

.ea-shop-grid {
    margin: 0;
    padding: 0;
}

.ea-shop-grid .ea-product-item {
    margin: 0;
}

.ea-product-card {
    height: 100%;
    min-width: 0;
}

.ea-product-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--ea-white);
    border: 1px solid var(--ea-border);
    border-radius: var(--ea-radius);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.ea-product-card-inner:hover {
    box-shadow: var(--ea-shadow-lg);
    transform: translateY(-4px);
}

.ea-product-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--ea-cream-dark);
    flex-shrink: 0;
}

.ea-product-img-link {
    display: block;
    height: 100%;
}

.ea-product-img-primary,
.ea-product-img-hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center;
    transition: opacity 0.4s ease, transform 0.5s ease;
}

.ea-product-img-hover {
    opacity: 0;
}

.ea-product-card-inner:hover .ea-product-img-primary {
    transform: scale(1.04);
}

.ea-product-card-inner:hover .ea-product-img-hover {
    opacity: 1;
}

.ea-product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 3;
}

.ea-prod-badge {
    display: inline-block;
    padding: 3px 9px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--ea-radius-sm);
    line-height: 1.4;
}

.ea-prod-badge-sale { background: var(--ea-danger); color: var(--ea-white); }
.ea-prod-badge-new { background: var(--ea-gold); color: var(--ea-white); }
.ea-prod-badge-oos { background: var(--ea-dark); color: var(--ea-white); }

.ea-product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 3;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ea-product-card-inner:hover .ea-product-actions {
    opacity: 1;
    transform: translateX(0);
}

.ea-prod-action {
    width: 34px;
    height: 34px;
    background: var(--ea-white);
    border: 1px solid var(--ea-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--ea-dark);
    cursor: pointer;
    text-decoration: none;
    transition: var(--ea-transition-fast);
    box-shadow: var(--ea-shadow-sm);
}

.ea-prod-action:hover {
    background: var(--ea-gold);
    border-color: var(--ea-gold);
    color: var(--ea-white) !important;
}

.ea-product-info {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ea-product-category {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ea-gold);
    margin: 0 0 5px;
}

.ea-product-name {
    font-family: var(--ea-font-heading);
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 8px;
    line-height: 1.3;
    flex: 1;
}

.ea-product-name a {
    color: var(--ea-dark);
    text-decoration: none;
}

.ea-product-name a:hover {
    color: var(--ea-gold);
}

.ea-product-price-wrap {
    margin-bottom: 12px;
}

.ea-product-price-wrap .woocommerce-Price-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ea-gold-dark);
}

.ea-product-price-wrap ins {
    text-decoration: none;
}

.ea-product-price-wrap del {
    font-size: 0.82rem;
    color: var(--ea-gray);
    font-weight: 400;
    margin-right: 5px;
    opacity: 0.8;
}

.ea-product-price-wrap del .woocommerce-Price-amount {
    font-size: 0.82rem;
    color: var(--ea-gray);
    font-weight: 400;
}

.ea-product-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 9px 14px;
    background: var(--ea-black);
    color: var(--ea-white) !important;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 2px solid var(--ea-black);
    border-radius: var(--ea-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: var(--ea-transition-fast);
    margin-top: auto;
}

.ea-product-add-btn:hover {
    background: var(--ea-gold);
    border-color: var(--ea-gold);
    color: var(--ea-white) !important;
}

.ea-product-add-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ea-product-add-btn-oos {
    background: var(--ea-gray-light);
    border-color: var(--ea-border);
    color: var(--ea-gray) !important;
    cursor: not-allowed;
}

.ea-product-add-btn-oos:hover {
    background: var(--ea-gray-light);
    border-color: var(--ea-border);
    color: var(--ea-gray) !important;
}

/* ============================================
   SHOP PAGINATION
   ============================================ */

.ea-shop-pagination {
    margin-top: 52px;
    padding-top: 32px;
    border-top: 1px solid #f0ebe0;
}

.ea-shop-pagination .pagination {
    gap: 6px;
    flex-wrap: wrap;
}

.ea-shop-pagination .page-item .page-link {
    color: var(--ea-black);
    border: 1.5px solid #e8e0d0;
    border-radius: 8px !important;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0;
    transition: all 0.2s ease;
    background: #fff;
    font-family: var(--ea-font-body);
    text-decoration: none;
}

.ea-shop-pagination .page-item .page-link:hover {
    background: var(--ea-cream);
    border-color: var(--ea-gold);
    color: var(--ea-gold-dark);
}

.ea-shop-pagination .page-item.active .page-link {
    background: var(--ea-gold);
    border-color: var(--ea-gold);
    color: #fff;
    box-shadow: 0 4px 14px rgba(201, 168, 76, 0.35);
}

.ea-shop-pagination .page-item.disabled .page-link {
    color: #ccc;
    border-color: #eee;
    background: #fafafa;
    pointer-events: none;
}

/* ============================================
   NO PRODUCTS FOUND
   ============================================ */

.woocommerce-no-products-found {
    text-align: center;
    padding: 64px 20px;
}

.woocommerce-no-products-found p {
    color: #888;
    font-size: 1rem;
    margin-bottom: 20px;
}

/* ============================================
   WC NOTICES
   ============================================ */

.woocommerce-notices-wrapper {
    margin-bottom: 24px;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border-radius: 8px;
    padding: 12px 18px 12px 40px !important;
    margin: 0 auto 20px !important;
    font-size: 0.9rem;
    list-style: none;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: 52px !important;
    line-height: 1.5 !important;
    clear: both !important;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    top: 50% !important;
    left: 14px !important;
    transform: translateY(-50%) !important;
}

.woocommerce-message .button,
.woocommerce-info .button {
    float: none !important;
    margin-left: auto !important;
    flex: 0 0 auto !important;
}

.woocommerce-message {
    background: #f2faf2;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.woocommerce-info {
    background: #fffbf0;
    border-left: 4px solid var(--ea-gold);
    color: #6b4f12;
}

.woocommerce-error {
    background: #fff5f5;
    border-left: 4px solid #ef5350;
    color: #c62828;
}

/* ============================================
   OFFCANVAS SIDEBAR STYLES (mobile)
   ============================================ */

.offcanvas-lg.ea-sidebar-offcanvas .offcanvas-header {
    border-bottom: 1px solid #f0ebe0;
    padding: 16px 20px;
}

.offcanvas-lg.ea-sidebar-offcanvas .offcanvas-title {
    font-family: var(--ea-font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ea-black);
}

.offcanvas-lg.ea-sidebar-offcanvas .offcanvas-body {
    padding: 20px 16px;
}

/* On desktop: remove offcanvas padding, let sidebar handle it */
@media (min-width: 992px) {
    .offcanvas-lg.ea-sidebar-offcanvas {
        border: none;
        background: transparent;
    }

    .offcanvas-lg.ea-sidebar-offcanvas .offcanvas-body {
        padding: 0;
        overflow-y: visible;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .ea-shop-sidebar-col {
        padding-right: 12px;
    }

    .woocommerce .ea-shop-grid.products,
    ul.products.ea-shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 16px;
    }

    .ea-shop-main-col-wide .ea-shop-grid.products,
    .ea-shop-main-col-wide ul.products.ea-shop-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px 14px;
    }

    .ea-wc-main-wrapper {
        padding: 28px 0 48px;
    }
}

@media (max-width: 767.98px) {
    .ea-shop-header {
        padding: 20px 0 24px;
    }

    .ea-shop-toolbar {
        padding: 10px 14px;
        gap: 8px;
    }

    .ea-orderby-select {
        font-size: 0.82rem;
        padding: 6px 28px 6px 10px;
    }

    .ea-wc-main-wrapper {
        padding: 20px 0 40px;
    }

    .ea-wc-main-wrapper > .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .ea-shop-main-col-wide .ea-shop-grid.products,
    .ea-shop-main-col-wide ul.products.ea-shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .woocommerce .ea-shop-grid.products,
    ul.products.ea-shop-grid {
        gap: 18px 12px;
    }

    .ea-product-info {
        padding: 10px 10px 12px;
    }

    .ea-product-name {
        font-size: 0.88rem;
    }

    .ea-product-add-btn {
        font-size: 0.68rem;
        padding: 8px 10px;
    }

    .ea-shop-pagination .page-item .page-link {
        width: 36px;
        height: 36px;
        font-size: 0.82rem;
        border-radius: 6px !important;
    }

    .ea-shop-pagination .pagination {
        gap: 4px;
    }
}
