/* ==========================================================================
   Gentora — product card + listing pages
   Uses only --brand-* tokens from gentora-brand.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Product card (.gj-card) — shared by homepage, listing, search, shop
   -------------------------------------------------------------------------- */
.gj-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: transparent;
    color: var(--brand-ink, #1F1A17);
    font-family: var(--brand-font-sans);
}

.gj-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--brand-ivory, #FAF6F0);
    border-radius: var(--brand-radius, 8px);
    overflow: hidden;
}

.gj-card-img-link { display: block; width: 100%; height: 100%; }

.gj-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .35s ease, transform .5s ease;
}

.gj-card-img-hover { opacity: 0; }

@media (hover: hover) and (min-width: 992px) {
    .gj-card:hover .gj-card-img { transform: scale(1.03); }
    .gj-card:hover .gj-card-img-hover { opacity: 1; }
}

.gj-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.4;
    color: var(--brand-on-primary, #fff);
    background: var(--brand-primary, #6E2433);
    border-radius: 4px;
    pointer-events: none;
}

.gj-card-badge-muted { background: var(--brand-ink, #1F1A17); }

.gj-card-wish {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--brand-ink, #1F1A17);
    background: rgba(255, 255, 255, .92);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}

.gj-card-wish:hover,
.gj-card-wish:focus-visible { color: var(--brand-primary, #6E2433); background: #fff; }

.gj-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px 2px 0;
}

.gj-card-title {
    margin: 0 0 6px;
    font-family: var(--brand-font-sans);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    min-height: calc(1.4em * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gj-card-title a { color: inherit; text-decoration: none; }
.gj-card-brand { font-weight: 700; color: var(--brand-ink, #1F1A17); }

/* Desktop/tablet: one line with ellipsis, like marketplace cards. Phones keep two lines. */
@media (min-width: 576px) {
    .gj-card-title {
        display: block;
        min-height: 0;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}
.gj-card-title a:hover { color: var(--brand-primary, #6E2433); }

.gj-card-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-ink, #1F1A17);
}

.gj-card-rating svg { color: var(--brand-gold, #B08A4E); }
.gj-card-rating-count { font-weight: 400; color: var(--brand-muted, #6F655C); }

.gj-card-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.gj-card-price-now { font-size: 16px; font-weight: 700; color: var(--brand-ink, #1F1A17); }
.gj-card-price-was { font-size: 13px; color: var(--brand-muted, #6F655C); text-decoration-thickness: 1px; }

/* Real discount: price first, then struck MRP and a soft red "N% OFF" pill (wraps on narrow cards). */
.gj-card-price-meta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }

.gj-card-price:has(+ .gj-card-offer) { margin-bottom: 4px; }
.gj-card-off {
    display: inline-flex; align-items: center;
    padding: 1px 7px; border-radius: 5px;
    background: #FDECEC; color: #C8242C;
    font-size: 11.5px; font-weight: 700; letter-spacing: .02em; line-height: 1.5;
    white-space: nowrap;
}

/* Best real effective price with a live coupon or the prepaid discount. */
.gj-card-offer {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.35;
    color: #1D4FB8;
}
.gj-card-offer strong { font-weight: 700; }

/* One button style for every card: solid garnet, quiet until hover. */
.gj-card-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    font-family: var(--brand-font-sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--brand-on-primary, #fff) !important;
    background: var(--brand-primary, #6E2433);
    border: 1px solid var(--brand-primary, #6E2433);
    border-radius: 6px;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.gj-card-btn:hover,
.gj-card-btn:focus-visible {
    background: var(--brand-primary-hover, #5A1C29);
    border-color: var(--brand-primary-hover, #5A1C29);
}

.gj-card-btn:disabled { opacity: .7; cursor: wait; }

.gj-card-btn-disabled {
    color: var(--brand-ink, #1F1A17) !important;
    background: var(--brand-bg, #fff);
    border-color: var(--brand-border, #E9E2D8);
}

.gj-card-btn-disabled:hover { background: var(--brand-ivory, #FAF6F0); border-color: var(--brand-border, #E9E2D8); }

@media (max-width: 575.98px) {
    .gj-card-title { font-size: 13px; }
    .gj-card-price-now { font-size: 15px; }
    .gj-card-price-was { font-size: 12px; }
    .gj-card-off { font-size: 10.5px; padding: 1px 5px; }
    .gj-card-offer { font-size: 12px; }
    .gj-card-btn { min-height: 38px; font-size: 12px; padding: 0 8px; }
    .gj-card-wish { width: 30px; height: 30px; }
}

/* --------------------------------------------------------------------------
   Listing page header
   -------------------------------------------------------------------------- */
.gj-listing-head {
    padding: 20px 0 8px;
    background: var(--brand-bg, #fff);
}

.gj-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--brand-muted, #6F655C);
}

.gj-crumbs a { color: var(--brand-muted, #6F655C); text-decoration: none; }
.gj-crumbs a:hover { color: var(--brand-primary, #6E2433); }
.gj-crumbs-current { color: var(--brand-ink, #1F1A17); }

.gj-listing-title {
    margin: 8px 0 0;
    font-family: var(--brand-font-serif);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    color: var(--brand-ink, #1F1A17);
}

/* --------------------------------------------------------------------------
   Listing body
   -------------------------------------------------------------------------- */
.gj-listing { background: var(--brand-bg, #fff); padding-top: 12px; }

.gj-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--brand-border, #E9E2D8);
    background: var(--brand-bg, #fff);
}

.gj-toolbar-count { font-size: 14px; color: var(--brand-muted, #6F655C); }
.gj-toolbar-count #total_product_count { font-weight: 600; color: var(--brand-ink, #1F1A17); }
.gj-toolbar-loading { margin-left: 8px; font-size: 12px; }

.gj-toolbar-actions { display: flex; align-items: center; gap: 8px; }

.gj-toolbar-btn,
.gj-sort-select {
    height: 40px;
    font-family: var(--brand-font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-ink, #1F1A17);
    background: var(--brand-bg, #fff);
    border: 1px solid var(--brand-border, #E9E2D8);
    border-radius: 6px;
}

.gj-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    cursor: pointer;
}

.gj-sort { position: relative; margin: 0; }

.gj-sort-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0 34px 0 12px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236F655C' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.gj-toolbar-btn:hover,
.gj-sort-select:hover,
.gj-sort-select:focus { border-color: var(--brand-ink, #1F1A17); outline: none; }

/* Mobile: toolbar sticks under the viewport top while scrolling results */
@media (max-width: 1199.98px) {
    .gj-toolbar {
        position: sticky;
        top: 0;
        z-index: 20;
        margin: 0 -15px 16px;
        padding: 10px 15px;
    }
    .gj-toolbar-actions { flex: 1; justify-content: flex-end; }
}

@media (max-width: 575.98px) {
    .gj-toolbar-count { font-size: 13px; }
    .gj-toolbar-actions { gap: 6px; }
    .gj-toolbar-btn, .gj-sort-select { height: 38px; font-size: 12px; }
    .gj-sort-select { max-width: 160px; }
}

/* Grid spacing */
.gj-grid { margin-left: -8px; margin-right: -8px; }
.gj-grid > .col { padding-left: 8px; padding-right: 8px; margin-bottom: 28px !important; }

@media (min-width: 768px) {
    .gj-grid { margin-left: -12px; margin-right: -12px; }
    .gj-grid > .col { padding-left: 12px; padding-right: 12px; margin-bottom: 36px !important; }
}

/* Empty state */
.gj-empty {
    max-width: 420px;
    margin: 32px auto;
    padding: 32px 24px;
    text-align: center;
    background: var(--brand-ivory, #FAF6F0);
    border-radius: var(--brand-radius, 8px);
}

.gj-empty-title { margin: 0 0 6px; font-family: var(--brand-font-serif); font-size: 20px; font-weight: 600; color: var(--brand-ink, #1F1A17); }
.gj-empty-text { margin: 0 0 18px; font-size: 14px; color: var(--brand-muted, #6F655C); }
.gj-empty-btn { width: auto; padding: 0 24px; }

/* --------------------------------------------------------------------------
   Filter sidebar (desktop column + mobile drawer)
   -------------------------------------------------------------------------- */
.gj-listing .gentora-filter-sidebar-inner { background: var(--brand-bg, #fff); }

@media (min-width: 1200px) {
    .gj-listing .gentora-filter-sidebar-inner {
        padding-right: 12px;
        border: 0 !important;
        box-shadow: none !important;
    }
}

.gj-listing .gentora-sidebar-section {
    margin-bottom: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--brand-border, #E9E2D8) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.gj-listing .gentora-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 !important;
    cursor: pointer;
    background: transparent !important;
}

.gj-listing .gentora-sidebar-title {
    font-family: var(--brand-font-sans);
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--brand-ink, #1F1A17) !important;
}

.gj-listing .gentora-collapse-icon { color: var(--brand-muted, #6F655C); transition: transform .2s ease; }
.gj-listing .gentora-sidebar-header[aria-expanded="false"] .gentora-collapse-icon { transform: rotate(-90deg); }
.gj-listing .gentora-sidebar-body { padding: 0 0 16px !important; }

.gj-listing .gentora-category-tree,
.gj-listing .gentora-category-tree label,
.gj-listing .gentora-category-tree span { font-size: 14px; color: var(--brand-ink, #1F1A17); }

.gj-listing .gentora-category-tree input[type="checkbox"],
.gj-listing .aiz-checkbox input { accent-color: var(--brand-primary, #6E2433); }

/* Price slider + inputs */
.gj-listing .noUi-connect { background: var(--brand-primary, #6E2433) !important; }
.gj-listing .noUi-handle {
    border: 2px solid var(--brand-primary, #6E2433) !important;
    background: #fff !important;
    box-shadow: none !important;
}

.gj-listing .gentora-price-input-box {
    border: 1px solid var(--brand-border, #E9E2D8) !important;
    border-radius: 6px !important;
    background: #fff !important;
}

.gj-listing .gentora-price-apply-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-ink, #1F1A17) !important;
    background: #fff !important;
    border: 1px solid var(--brand-ink, #1F1A17) !important;
    border-radius: 6px !important;
}

.gj-listing .gentora-price-apply-btn:hover { background: var(--brand-ink, #1F1A17) !important; color: #fff !important; }

/* Size / attribute chips */
.gj-listing .gentora-filter-size-btn {
    border: 1px solid var(--brand-border, #E9E2D8) !important;
    border-radius: 6px !important;
    color: var(--brand-ink, #1F1A17) !important;
    background: #fff !important;
}

.gj-listing .gentora-filter-size-btn.active {
    border-color: var(--brand-primary, #6E2433) !important;
    background: var(--brand-primary-soft, #F6ECEE) !important;
    color: var(--brand-primary, #6E2433) !important;
}

/* Clear / apply row */
.gj-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
}

.gj-filter-clear {
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-muted, #6F655C);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: 0;
    cursor: pointer;
}

.gj-filter-clear:hover { color: var(--brand-primary, #6E2433); }

.gj-filter-apply { flex: 1; width: auto; margin-top: 0; }

/* Mobile drawer */
@media (max-width: 1199.98px) {
    .gj-listing .gentora-filter-sidebar-inner { padding: 0 16px; }
    .gj-listing .gentora-drawer-header { margin: 0 -16px; padding: 16px !important; border-color: var(--brand-border, #E9E2D8) !important; }
    .gj-listing .gentora-drawer-title { font-family: var(--brand-font-serif); font-size: 20px; color: var(--brand-ink, #1F1A17); }
    .gj-filter-actions {
        position: sticky;
        bottom: 0;
        margin: 0 -16px;
        padding: 12px 16px;
        background: #fff;
        border-top: 1px solid var(--brand-border, #E9E2D8);
    }
}

/* Pagination */
.gj-listing .pagination .page-link {
    color: var(--brand-ink, #1F1A17);
    border-color: var(--brand-border, #E9E2D8);
}

.gj-listing .pagination .page-item.active .page-link {
    color: #fff;
    background: var(--brand-primary, #6E2433);
    border-color: var(--brand-primary, #6E2433);
}

/* Override legacy solid filter button + sidebar box (gentora-luxury.css) */
.gj-toolbar .gj-toolbar-btn.gentora-mobile-filter-btn {
    flex: 0 0 auto;
    width: auto;
    height: 40px;
    padding: 0 14px;
    color: var(--brand-ink, #1F1A17) !important;
    background: var(--brand-bg, #fff) !important;
    border: 1px solid var(--brand-border, #E9E2D8) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

@media (min-width: 1200px) {
    .gj-listing .aiz-filter-sidebar.collapse-sidebar-wrap.sidebar-xl.gentora-filter-sidebar-wrapper,
    .gj-listing .aiz-filter-sidebar .collapse-sidebar.scroll-bar-show.gentora-filter-sidebar-inner {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        padding-left: 0 !important;
    }
}
