/*
 * QATARSHOES THEME — HOMEPAGE COMPLETE THE LOOK SECTION
 *
 * Shop-the-look block in the "Complete the Looks" slot (section key
 * `restock`). Design: Figma "Complete the look" — QTRSHOE-400.
 *   Heading — the title, and a previous/next pager with a 01/05 counter.
 *   Desktop — one look of four selectable product cards in a ruled, rounded
 *             frame, and a footer bar: "N of 4 selected", "Clear selection",
 *             "ADD N TO CART".
 *   Mobile  — centred title, the same four cards in a 2×2 grid, dots to move
 *             between looks, then the add and clear buttons full width.
 *
 * Loaded after homepage-sections.css, so equal-specificity selectors here win
 * by cascade order. The section wears .featured-products-container and
 * .jsx-1401438402 so it inherits its neighbours' outer spacing and the
 * shared heading type; only what is particular to this block lives here.
 *
 * Logical properties (inset-inline-*, padding-inline-*) keep the layout
 * correct in Arabic/RTL without a mirrored stylesheet.
 */

/* ============================================
   SECTION SHELL
   ============================================ */

.page-homepage .complete-the-look-section {
    background: #ffffff;
    box-sizing: border-box;
}

/* Empty or single-look states are marked with [hidden] by PHP and by the
   script. The UA's [hidden] rule loses to the class rules below, so restate. */
.page-homepage .complete-the-look-section [hidden] {
    display: none !important;
}

/* ============================================
   HEADING ROW — title left, pager right
   ============================================ */

.page-homepage .ctl-heading-row {
    margin-bottom: 32px;
}

.page-homepage .ctl-pager {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: none;
}

/* Previous: outlined; Next: solid cocoa — as drawn */
.page-homepage .ctl-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    box-sizing: border-box;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    background: #ffffff;
    color: #2d1f1f;
    cursor: pointer;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.page-homepage .ctl-pager-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.page-homepage .ctl-pager-next {
    border-color: #2d1f1f;
    background: #2d1f1f;
    color: #ffffff;
}

/* At either end the arrow goes quiet rather than disappearing, so the
   counter keeps its place */
.page-homepage .ctl-pager-btn:disabled {
    cursor: default;
    color: #e0e0e0;
}

.page-homepage .ctl-pager-next:disabled {
    background: #ffffff;
    border-color: #e0e0e0;
}

.page-homepage .ctl-pager-btn:focus-visible {
    outline: 2px solid #2d1f1f;
    outline-offset: 2px;
}

/* Chevrons point the way the row reads */
html[dir="rtl"] .page-homepage .ctl-pager-btn svg {
    transform: scaleX(-1);
}

.page-homepage .ctl-pager-count {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 28px;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #888888;
    min-width: 56px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   FRAME + GRID
   The 1px rules between cards are the frame's own colour showing through
   a 1px gap — same device as the other product grids.
   ============================================ */

.page-homepage .ctl-frame {
    border: 1px solid #e0dcd3;
    border-radius: 24px;
    background: #e0dcd3;
    overflow: hidden;
}

/* Auto-flow columns: a look short of four (a small collection) still fills
   the width instead of leaving empty cells */
.page-homepage .ctl-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 1px;
}

/* ============================================
   PRODUCT CARD
   ============================================ */

.page-homepage .ctl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 546px;
    padding: 30px 32px;
    box-sizing: border-box;
    background: #ffffff;
}

.page-homepage .ctl-card-link {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.page-homepage .ctl-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 394px;
    overflow: hidden;
}

/* The photographs come in every proportion (a tote, a belt, a flat), so
   they are contained, not cropped, and centred in the fixed image box */
.page-homepage .ctl-card-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.page-homepage .ctl-card-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 32px;
    min-width: 0;
}

.page-homepage .ctl-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: 0;
    color: #2d1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-homepage .ctl-card-price {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    color: #7b7f7b;
}

.page-homepage .ctl-card-price .compare-price {
    margin-inline-start: 6px;
    text-decoration: line-through;
    color: #999999;
}

.page-homepage .ctl-card-price .price.has-discount {
    color: #f25c5e;
}

/* NEW / BEST SELLER — the shared badge (shopify-integration.css), moved to
   this card's 16px inset and up to the design's 14px */
.page-homepage .ctl-card > .new-badge,
.page-homepage .ctl-card > .best-seller-badge,
.page-homepage .ctl-card > .sold-out-badge {
    top: 16px;
    left: 16px;
    padding: 10px;
    border-left-width: 4px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2.25px;
    line-height: 1;
}

html[dir="rtl"] .page-homepage .ctl-card > .new-badge,
html[dir="rtl"] .page-homepage .ctl-card > .best-seller-badge,
html[dir="rtl"] .page-homepage .ctl-card > .sold-out-badge {
    left: auto;
    right: 16px;
    border-left: none;
    border-right-width: 4px;
}

/* --- Checkbox: white with a hairline when off, black with a tick when on --- */

.page-homepage .ctl-check {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    z-index: 6;
    width: 36px;
    height: 36px;
    margin: 0;
    cursor: pointer;
}

.page-homepage .ctl-check-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.page-homepage .ctl-check-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    border: 1px solid #e0dcd3;
    border-radius: 8px;
    background: #ffffff;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.page-homepage .ctl-check-box svg {
    width: 22px;
    height: 22px;
    display: block;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.page-homepage .ctl-check-input:checked + .ctl-check-box {
    background: #000000;
    border-color: #000000;
}

.page-homepage .ctl-check-input:checked + .ctl-check-box svg {
    opacity: 1;
}

.page-homepage .ctl-check-input:focus-visible + .ctl-check-box {
    outline: 2px solid #2d1f1f;
    outline-offset: 2px;
}

/* ============================================
   FOOTER BAR (desktop)
   ============================================ */

.page-homepage .ctl-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    padding: 13px 24px;
    padding-inline-start: 39px;
    box-sizing: border-box;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}

.page-homepage .ctl-footer-status {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.page-homepage .ctl-selected-count {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: #1a1a1a;
    text-transform: capitalize;
    white-space: nowrap;
}

.page-homepage .ctl-clear-link {
    padding: 0;
    border: 0;
    background: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-position: from-font;
    color: #888888;
    cursor: pointer;
    white-space: nowrap;
}

.page-homepage .ctl-clear-link:hover {
    color: #2d1f1f;
}

.page-homepage .ctl-clear-link:disabled {
    cursor: default;
    opacity: 0.5;
}

/* --- Add to cart: same solid pill as the sections' View More button,
       with the bag and a 12px radius as drawn --- */

.page-homepage .ctl-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 48px;
    padding: 0 18px;
    box-sizing: border-box;
    border: 0;
    border-radius: 12px;
    background: #2d1f1f;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.page-homepage .ctl-add-btn .ctl-icon-bag {
    width: 24px;
    height: 24px;
    flex: none;
    display: block;
}

.page-homepage .ctl-add-btn:hover {
    opacity: 0.9;
}

.page-homepage .ctl-add-btn:disabled {
    cursor: default;
    opacity: 0.45;
}

.page-homepage .ctl-add-btn.is-busy {
    cursor: progress;
    opacity: 0.7;
}

.page-homepage .ctl-add-btn:focus-visible {
    outline: 2px solid #2d1f1f;
    outline-offset: 2px;
}

/* Mobile-only controls stay out of the way on desktop */
.page-homepage .ctl-dots,
.page-homepage .ctl-mobile-actions {
    display: none;
}

/* ============================================
   LOADING SKELETON
   ============================================ */

.page-homepage .ctl-card--skeleton {
    justify-content: flex-start;
}

.page-homepage .ctl-skeleton-image {
    width: 100%;
    height: 394px;
    border-radius: 8px;
    background: #f2f0ec;
}

.page-homepage .ctl-skeleton-line {
    width: 80%;
    height: 14px;
    margin-top: 32px;
    border-radius: 4px;
    background: #f2f0ec;
}

.page-homepage .ctl-skeleton-line--short {
    width: 40%;
    margin-top: 12px;
}

/* ============================================
   MOBILE (max-width: 1023px)
   ============================================ */

@media (max-width: 1023px) {

    /* The shared mobile shell lays the section out as a centred column;
       every block in it spans the full width */
    .page-homepage .ctl-heading-row,
    .page-homepage .ctl-frame,
    .page-homepage .ctl-mobile-actions {
        width: 100%;
    }

    /* Title is centred by the shared heading rule; the pager gives way to
       the dots under the grid */
    .page-homepage .ctl-heading-row {
        margin-bottom: 0;
    }

    .page-homepage .ctl-pager {
        display: none !important;
    }

    .page-homepage .ctl-frame {
        border-radius: 12px;
    }

    .page-homepage .ctl-grid {
        grid-auto-flow: row;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Badge and checkbox stay in the corners; the top padding keeps the
       photograph clear of them (10px inset + 32px control + 16px gap) */
    .page-homepage .ctl-card {
        min-height: 0;
        padding: 58px 10px 16px;
    }

    .page-homepage .ctl-card-image {
        height: 148px;
    }

    .page-homepage .ctl-card-text {
        gap: 8px;
        margin-top: 15px;
    }

    /* Two lines of title rather than one clipped one */
    .page-homepage .ctl-card-title {
        font-size: 12px;
        line-height: normal;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .page-homepage .ctl-card-price {
        font-size: 12px;
        line-height: normal;
    }

    .page-homepage .ctl-card > .new-badge,
    .page-homepage .ctl-card > .best-seller-badge,
    .page-homepage .ctl-card > .sold-out-badge {
        top: 18px;
        left: 10px;
        padding: 5px 6px;
        border-left-width: 2px;
        font-size: 8px;
        letter-spacing: 1.27px;
    }

    html[dir="rtl"] .page-homepage .ctl-card > .new-badge,
    html[dir="rtl"] .page-homepage .ctl-card > .best-seller-badge,
    html[dir="rtl"] .page-homepage .ctl-card > .sold-out-badge {
        left: auto;
        right: 10px;
        border-right-width: 2px;
    }

    .page-homepage .ctl-check {
        top: 10px;
        inset-inline-end: 10px;
        width: 32px;
        height: 32px;
    }

    .page-homepage .ctl-check-box {
        width: 32px;
        height: 32px;
        border-radius: 7px;
    }

    .page-homepage .ctl-check-box svg {
        width: 20px;
        height: 20px;
    }

    .page-homepage .ctl-footer {
        display: none;
    }

    /* --- Dots: one per look, the current one stretched --- */
    .page-homepage .ctl-dots {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 16px;
    }

    .page-homepage .ctl-dot {
        width: 5px;
        height: 5px;
        padding: 0;
        border: 0;
        border-radius: 3px;
        background: rgba(26, 26, 24, 0.22);
        cursor: pointer;
        transition: width 0.2s ease, background-color 0.2s ease;
    }

    .page-homepage .ctl-dot.is-active {
        width: 18px;
        background: #2d1f1f;
    }

    .page-homepage .ctl-dot:focus-visible {
        outline: 2px solid #2d1f1f;
        outline-offset: 2px;
    }

    /* --- Add (full width) + Clear (outlined) --- */
    .page-homepage .ctl-mobile-actions {
        display: flex;
        align-items: stretch;
        gap: 16px;
        margin-top: 32px;
    }

    .page-homepage .ctl-add-btn--mobile {
        flex: 1 1 auto;
        min-width: 0;
    }

    .page-homepage .ctl-clear-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        height: 48px;
        padding: 0 16px;
        box-sizing: border-box;
        border: 1px solid #2d1f1f;
        border-radius: 12px;
        background: #ffffff;
        color: #2d1f1f;
        font-family: 'Inter', sans-serif;
        font-size: 14px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 1px;
        text-transform: uppercase;
        cursor: pointer;
    }

    .page-homepage .ctl-clear-btn:disabled {
        cursor: default;
        opacity: 0.45;
    }

    .page-homepage .ctl-clear-btn:focus-visible {
        outline: 2px solid #2d1f1f;
        outline-offset: 2px;
    }

    .page-homepage .ctl-skeleton-image {
        height: 148px;
    }

    .page-homepage .ctl-skeleton-line {
        margin-top: 15px;
    }
}
