/**
 * Product listing — styled after Amazon.in
 * Ref: https://www.amazon.in/
 */
.ecom-shop {
    --amz-bg: #eaeded;
    --amz-white: #fff;
    --amz-text: #0f1111;
    --amz-muted: #565959;
    --amz-link: #007185;
    --amz-link-hover: #c7511f;
    --amz-orange: #ff9900;
    --amz-orange-dark: #e88b00;
    --amz-yellow: #ffd814;
    --amz-yellow-hover: #f7ca00;
    --amz-yellow-border: #fcd200;
    --amz-deal-red: #cc0c39;
    --amz-price-deal: #b12704;
    --amz-green: #007600;
    --amz-border: #d5d9d9;
    --amz-dark: #232f3e;
    --amz-font: "Amazon Ember", Arial, sans-serif;

    background: var(--amz-bg);
    padding: 88px 0 2.5rem;
    min-height: 60vh;
    font-family: var(--amz-font);
    width: 100%;
    box-sizing: border-box;
}

/* When hero carousel is present, sit it directly under the fixed header */
.ecom-shop--with-hero {
    padding-top: 0;
}

/* Full-width page container */
.ecom-fluid {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .ecom-fluid {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Layout row — sidebar + products side by side */
.ecom-layout-wrap {
    padding-top: 8px;
}

.ecom-layout-row {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: stretch;
    background: var(--amz-white);
    border: 1px solid var(--amz-border);
    width: 100%;
}

.ecom-layout-sidebar {
    flex: 0 0 260px;
    width: 260px;
    max-width: 260px;
}

.ecom-layout-content {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.ecom-main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 0 14px 14px;
    background: var(--amz-white);
    box-sizing: border-box;
}

/* Breadcrumb — Amazon style */
.ecom-shop__breadcrumb {
    background: var(--amz-white);
    padding: 0.5rem 0;
    font-size: 12px;
    color: var(--amz-muted);
}

.ecom-shop__breadcrumb a {
    color: var(--amz-link);
    text-decoration: none;
}

.ecom-shop__breadcrumb a:hover {
    color: var(--amz-link-hover);
    text-decoration: underline;
}

.ecom-shop__breadcrumb span {
    margin: 0 0.25rem;
    color: var(--amz-muted);
}

/* Amazon-style search strip */
.ecom-search-hero {
    background: var(--amz-dark);
    padding: 14px 0 18px;
}

.ecom-search-hero__inner {
    display: flex;
    gap: 0;
    max-width: 100%;
}

.ecom-search-hero__scope {
    background: #f3f3f3;
    border: none;
    border-radius: 4px 0 0 4px;
    padding: 0 12px;
    font-size: 12px;
    color: var(--amz-muted);
    display: flex;
    align-items: center;
    white-space: nowrap;
    border-right: 1px solid #cdcdcd;
}

.ecom-search-hero__form {
    flex: 1;
    display: flex;
}

.ecom-search-hero__input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 15px;
    outline: none;
}

.ecom-search-hero__btn {
    background: var(--amz-orange);
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 0 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ecom-search-hero__btn:hover {
    background: var(--amz-orange-dark);
}

.ecom-search-hero__btn svg {
    width: 22px;
    height: 22px;
    fill: var(--amz-dark);
}

/* Products page hero carousel (admin-managed banners) */
.ecom-hero-carousel {
    background: var(--amz-white);
    margin-top: 88px;
    margin-bottom: 8px;
    line-height: 0;
}

.ecom-hero-carousel .carousel {
    max-width: 100%;
}

.ecom-hero-carousel .carousel-inner {
    border-radius: 0;
    overflow: hidden;
    background: var(--amz-white);
    aspect-ratio: 1920 / 480;
    max-height: 480px;
}

.ecom-hero-carousel .carousel-item {
    aspect-ratio: 1920 / 480;
    width: 100%;
    max-height: 480px;
    height: 100%;
}

.ecom-hero-carousel__link {
    display: block;
    line-height: 0;
    height: 100%;
}

.ecom-hero-carousel__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.ecom-hero-carousel__control {
    width: 8%;
    opacity: 1;
}

.ecom-hero-carousel__control .carousel-control-prev-icon,
.ecom-hero-carousel__control .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
    filter: invert(1) grayscale(100);
}

.ecom-hero-carousel .carousel-indicators {
    margin-bottom: 0.75rem;
}

.ecom-hero-carousel .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(15, 17, 17, 0.35);
    border: none;
}

.ecom-hero-carousel .carousel-indicators .active {
    background-color: var(--amz-orange);
}

/* Today's Deals / Featured — legacy, kept for reference */
.ecom-featured {
    background: var(--amz-white);
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--amz-border);
}

.ecom-featured__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 14px 0 10px;
    border-bottom: 1px solid #f0f0f0;
}

.ecom-featured__title {
    font-size: 21px;
    font-weight: 700;
    color: var(--amz-text);
    margin: 0;
    line-height: 1.2;
}

.ecom-featured__see-all {
    font-size: 13px;
    color: var(--amz-link);
    text-decoration: none;
}

.ecom-featured__see-all:hover {
    color: var(--amz-link-hover);
    text-decoration: underline;
}

.ecom-featured__scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 12px 0 16px;
    scroll-snap-type: x mandatory;
}

.ecom-featured-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    padding: 0 10px;
    text-decoration: none;
    color: inherit;
    border-right: 1px solid #f0f0f0;
}

.ecom-featured-card:last-child {
    border-right: none;
}

.ecom-featured-card:hover .ecom-featured-card__name {
    color: var(--amz-link-hover);
}

.ecom-featured-card__img {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.ecom-featured-card__img img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.ecom-featured-card__deal {
    font-size: 11px;
    font-weight: 700;
    color: var(--amz-deal-red);
    margin: 0 0 4px;
}

.ecom-featured-card__name {
    font-size: 13px;
    line-height: 1.35;
    color: var(--amz-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 6px;
}

.ecom-featured-card__price {
    font-size: 18px;
    font-weight: 400;
    color: var(--amz-text);
    margin: 0;
}

.ecom-featured-card__price sup {
    font-size: 11px;
    top: -0.4em;
}

/* Layout */
@media (max-width: 991px) {
    .ecom-layout-row {
        flex-wrap: wrap;
    }

    .ecom-layout-sidebar {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    .ecom-layout-content {
        width: 100%;
    }
}

/* Legacy grid alias — keep for compatibility */
.ecom-layout {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    background: var(--amz-white);
    border: 1px solid var(--amz-border);
}

/* Left filters — Amazon refine panel */
.ecom-filters {
    background: var(--amz-white);
    border-right: 1px solid var(--amz-border);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    border-radius: 0;
}

.ecom-filters__head {
    padding: 12px 14px 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--amz-text);
    border-bottom: 1px solid #e7e7e7;
}

.ecom-filters__head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ecom-filters__hide-btn {
    background: none;
    border: none;
    color: var(--amz-link);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    padding: 0;
}

.ecom-filters__hide-btn:hover {
    color: var(--amz-link-hover);
    text-decoration: underline;
}

@media (max-width: 991px) {
    .ecom-filters__hide-btn {
        display: none;
    }
}

.ecom-filter-show-btn {
    display: none;
    background: var(--amz-white);
    border: 1px solid var(--amz-border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
}

@media (min-width: 992px) {
    .ecom-filter-show-btn:not([hidden]) {
        display: inline-block;
    }

    .ecom-layout-row.filters-hidden .ecom-layout-sidebar {
        display: none;
    }

    .ecom-layout-row.filters-hidden .ecom-layout-content {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }
}

.ecom-filters__clear {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--amz-link);
    text-decoration: none;
    margin-top: 4px;
}

.ecom-filters__clear:hover {
    color: var(--amz-link-hover);
    text-decoration: underline;
}

.ecom-filter-block {
    padding: 0 14px;
    border-bottom: 1px solid #e7e7e7;
}

.ecom-filter-block:last-child {
    padding-bottom: 10px;
}

.ecom-filter-toggle-section {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 0;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--amz-text);
    text-align: left;
}

.ecom-filter-toggle-section:hover {
    color: var(--amz-link-hover);
}

.ecom-filter-chevron {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--amz-muted);
    border-bottom: 2px solid var(--amz-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -3px;
}

.ecom-filter-block.is-open .ecom-filter-chevron {
    transform: rotate(-135deg);
    margin-top: 3px;
}

.ecom-filter-panel {
    display: none;
    padding-bottom: 14px;
}

.ecom-filter-block.is-open .ecom-filter-panel {
    display: block;
}

.ecom-filter-block__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--amz-text);
    margin: 0 0 8px;
    text-transform: none;
    letter-spacing: 0;
}

.ecom-search-row {
    display: flex;
    border: 1px solid var(--amz-border);
    border-radius: 4px;
    overflow: hidden;
}

.ecom-search-row input {
    flex: 1;
    border: none;
    padding: 7px 10px;
    font-size: 13px;
    outline: none;
}

.ecom-search-row button {
    background: var(--amz-yellow);
    border: none;
    border-left: 1px solid var(--amz-yellow-border);
    padding: 0 12px;
    font-size: 13px;
    cursor: pointer;
}

.ecom-search-row button:hover {
    background: var(--amz-yellow-hover);
}

.ecom-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.ecom-filter-link {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    text-decoration: none;
    color: var(--amz-text);
    font-size: 13px;
    line-height: 1.4;
}

.ecom-filter-link:hover {
    color: var(--amz-link-hover);
    text-decoration: underline;
}

.ecom-filter-link.is-active {
    font-weight: 700;
    color: var(--amz-link-hover);
}

.ecom-filter-link .count {
    color: var(--amz-muted);
    font-size: 12px;
}

.ecom-filter-link .brand-tag {
    display: block;
    font-size: 11px;
    color: var(--amz-muted);
}

.ecom-price-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.ecom-price-row input {
    flex: 1;
    border: 1px solid var(--amz-border);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    box-shadow: 0 1px 2px rgba(15, 17, 17, 0.15) inset;
}

.ecom-btn-apply {
    width: 100%;
    background: var(--amz-yellow);
    border: 1px solid var(--amz-yellow-border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--amz-text);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
}

.ecom-btn-apply:hover {
    background: var(--amz-yellow-hover);
}

.ecom-select {
    width: 100%;
    border: 1px solid var(--amz-border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    background: #f0f2f2;
    box-shadow: 0 1px 2px rgba(15, 17, 17, 0.15) inset;
}

/* Results area */
.ecom-toolbar {
    padding: 12px 0;
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e7e7e7;
    background: transparent;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.ecom-toolbar__title {
    font-size: 15px;
    font-weight: 400;
    color: var(--amz-text);
    margin: 0;
}

.ecom-toolbar__meta {
    font-size: 14px;
    color: var(--amz-muted);
    margin: 0;
}

.ecom-toolbar__meta strong {
    color: var(--amz-text);
}

.ecom-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ecom-toolbar__sort-label {
    font-size: 14px;
    color: var(--amz-text);
}

.ecom-toolbar__sort {
    border: 1px solid var(--amz-border);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    background: #f0f2f2;
    box-shadow: 0 1px 2px rgba(15, 17, 17, 0.15) inset;
    min-width: 200px;
}

.ecom-filter-toggle {
    display: none;
    background: var(--amz-white);
    border: 1px solid var(--amz-border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
}

/* Product grid — equal columns, full width */
.ecom-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid #e7e7e7;
}

@media (min-width: 640px) {
    .ecom-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .ecom-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .ecom-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 1500px) {
    .ecom-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.ecom-product-card {
    background: var(--amz-white);
    border: none;
    border-right: 1px solid #e7e7e7;
    border-bottom: 1px solid #e7e7e7;
    border-radius: 0;
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    transition: none;
    height: 100%;
}

.ecom-product-card:hover {
    box-shadow: none;
    z-index: 1;
    outline: 1px solid var(--amz-border);
    outline-offset: -1px;
}

.ecom-product-card__media {
    display: block;
    position: relative;
    text-align: center;
    min-height: 200px;
    margin-bottom: 8px;
    padding: 4px;
}

.ecom-product-card__media img {
    max-width: 100%;
    max-height: 190px;
    object-fit: contain;
}

.ecom-badge {
    position: absolute;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.ecom-badge--off {
    top: 0;
    left: 0;
    color: var(--amz-deal-red);
    background: transparent;
    padding: 0;
}

.ecom-badge--deal {
    display: block;
    position: static;
    color: var(--amz-deal-red);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ecom-product-card__body {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ecom-product-card__title {
    font-size: 14px;
    font-weight: 400;
    color: var(--amz-link);
    line-height: 1.4;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    min-height: auto;
}

.ecom-product-card__title:hover {
    color: var(--amz-link-hover);
    text-decoration: underline;
}

.ecom-product-card__snippet {
    display: none;
}

.ecom-product-card__rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 13px;
}

.ecom-stars {
    display: inline-flex;
    gap: 1px;
}

.ecom-star {
    width: 14px;
    height: 14px;
    background: var(--amz-orange);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.ecom-star--empty {
    background: #e0e0e0;
}

.ecom-rating-count {
    color: var(--amz-link);
    font-size: 13px;
}

.ecom-rating-count:hover {
    color: var(--amz-link-hover);
    text-decoration: underline;
}

.ecom-product-card__price-block {
    margin-bottom: 8px;
    flex: 1;
}

.ecom-price-row-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
}

.ecom-price-current {
    font-size: 21px;
    font-weight: 400;
    color: var(--amz-text);
    line-height: 1.2;
}

.ecom-price-current--deal {
    color: var(--amz-price-deal);
}

.ecom-price-mrp-wrap {
    font-size: 13px;
    color: var(--amz-muted);
}

.ecom-price-mrp-wrap .label {
    margin-right: 2px;
}

.ecom-price-mrp {
    text-decoration: line-through;
}

.ecom-price-off {
    font-size: 13px;
    color: var(--amz-price-deal);
    display: block;
    margin-top: 2px;
}

.ecom-delivery-tag {
    font-size: 12px;
    color: var(--amz-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.ecom-delivery-tag b {
    color: var(--amz-green);
    font-weight: 700;
}

.ecom-stock--out {
    color: var(--amz-price-deal);
    font-size: 12px;
    font-weight: 700;
}

.ecom-product-card__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}

.ecom-btn-cart {
    width: 100%;
    background: var(--amz-yellow);
    border: 1px solid var(--amz-yellow-border);
    border-radius: 20px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--amz-text);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
}

.ecom-btn-cart:hover:not(:disabled) {
    background: var(--amz-yellow-hover);
}

.ecom-btn-cart:disabled {
    background: #e9e9e9;
    border-color: #ddd;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.ecom-btn-buy {
    width: 100%;
    background: var(--amz-orange);
    border: 1px solid var(--amz-orange-dark);
    border-radius: 20px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--amz-text);
    text-align: center;
    text-decoration: none;
    display: block;
    box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
}

.ecom-btn-buy:hover {
    background: var(--amz-orange-dark);
    color: var(--amz-text);
}

.ecom-empty {
    padding: 48px 20px;
    text-align: center;
}

.ecom-pagination {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e7e7e7;
    display: flex;
    justify-content: center;
}

.ecom-pagination .page-link {
    color: var(--amz-text);
    border-color: var(--amz-border);
    font-size: 13px;
}

.ecom-pagination .page-item.active .page-link {
    background: var(--amz-orange);
    border-color: var(--amz-orange);
    color: var(--amz-text);
}

@media (max-width: 991px) {
    .ecom-layout-row {
        flex-wrap: wrap;
    }

    .ecom-layout-sidebar {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    .ecom-filter-toggle {
        display: inline-block;
    }

    .ecom-filters {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: min(300px, 88vw);
        height: 100vh;
        z-index: 1050;
        max-height: none;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
    }

    .ecom-filters.is-open {
        display: block;
    }

    .ecom-filters-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .ecom-filters-overlay.is-open {
        display: block;
    }

    .ecom-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .ecom-grid {
        grid-template-columns: 1fr;
    }

    .ecom-toolbar__sort {
        min-width: 140px;
    }

    .ecom-product-card__media {
        min-height: 180px;
    }
}
