/**
 * Size guides: shoes, rings, bracelets (ARKAN-425)
 *
 * Values from the "Final" product page design (Final-Bags = shoes,
 * Final-Rings, Final-Bracelets; desktop and mobile boards). Markup:
 * inc/core/size-guide.php. Behaviour: js/size-guide.js.
 *
 * Fonts: the site's (ARKAN-327); the design's Georgia parts (tabs, the
 * measurements title, step numbers) in the heading face, Cormorant Garamond.
 *
 * Desktop: a 520px panel from the side (the other side in Arabic).
 * Phones and tablets (up to 1023px, as the product page): a sheet from the bottom.
 */

.qs-sg-layer {
    position: fixed;
    inset: 0;
    z-index: 100001; /* above the header, the filter drawer (999) and other drawers */
    font-family: var(--qs-font-body, 'Inter', 'IBM Plex Sans Arabic', sans-serif);
    color: #1A1A1A;
    -webkit-font-smoothing: antialiased;
}

.qs-sg-layer[hidden] {
    display: none;
}

.qs-sg-layer *,
.qs-sg-layer *::before,
.qs-sg-layer *::after {
    box-sizing: border-box;
}

.qs-sg-scrim {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(26, 26, 26, 0.38);
    opacity: 0;
    cursor: default;
    transition: opacity 300ms ease;
}

.qs-sg {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 520px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    box-shadow: -2px 0 16px rgba(26, 26, 26, 0.10);
    transform: translateX(100%);
    transition: transform 340ms cubic-bezier(.22, .61, .36, 1);
    outline: none;
    text-align: left;
}

html[dir="rtl"] .qs-sg {
    right: auto;
    left: 0;
    box-shadow: 2px 0 16px rgba(26, 26, 26, 0.10);
    transform: translateX(-100%);
    text-align: right;
}

.qs-sg-layer.is-open .qs-sg-scrim {
    opacity: 1;
}

.qs-sg-layer.is-open .qs-sg {
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .qs-sg,
    .qs-sg-scrim {
        transition: none;
    }
}

.qs-sg-handle {
    display: none;
}

/* Title bar and tabs (they stay while the content scrolls) */
.qs-sg-top {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    background: #FFFFFF;
}

.qs-sg-head {
    box-sizing: content-box;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px 0 28px;
    border-bottom: 1px solid #EFECE7;
}

html[dir="rtl"] .qs-sg-head {
    padding: 0 28px 0 32px;
}

.qs-sg-title {
    margin: 0;
    font-family: inherit;
    font-size: 19px;
    font-weight: 600;
    line-height: normal;
    letter-spacing: 0;
    text-transform: none;
    color: #1A1A1A;
}

.qs-sg-close {
    width: 44px;
    height: 44px;
    margin: 0 -10px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1A1A1A;
    cursor: pointer;
}

html[dir="rtl"] .qs-sg-close {
    margin: 0 0 0 -10px;
}

.qs-sg-tabs {
    display: flex;
    width: 100%;
    padding-top: 18px;
    border-bottom: 1px solid #D9D9D9;
}

.qs-sg-tab {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 -1px;
    padding: 0 4px 14px;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    background: none;
    font-family: var(--qs-font-heading, 'Cormorant Garamond', 'IBM Plex Sans Arabic', serif);
    font-size: 18px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    color: #8A8282;
    cursor: pointer;
}

.qs-sg-tab[aria-selected="true"] {
    border-bottom: 2px solid #2D1F1F;
    color: #2D1F1F;
}

.qs-sg-tab svg {
    flex-shrink: 0;
}

/* A guide with one tab (the watch size guides): the whole width, as the HMS Watches board */
.qs-sg-tab--only {
    flex: 0 0 100%;
    width: 100%;
}

.qs-sg-tab--only[aria-selected="true"] {
    border-bottom-color: #1A1A1A;
    color: #1A1A1A;
}

/* Content */
.qs-sg-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 26px 40px 28px;
}

.qs-sg-panel {
    display: flex;
    flex-direction: column;
}

.qs-sg-panel[hidden] {
    display: none;
}

.qs-sg-layer p {
    margin: 0;
}

/* Select a location (rings) */
.qs-sg-loc {
    position: relative;
    display: block;
    margin: 18px 0 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #8A8A8A;
    cursor: pointer;
}

.qs-sg-loc-label {
    display: block;
    font-size: 12px;
    line-height: normal;
    color: #6F6F6F;
}

.qs-sg-loc-select {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: auto;
    margin: 4px 0 0;
    padding: 0 28px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    line-height: normal;
    color: #1A1A1A;
    cursor: pointer;
    outline: none;
    box-shadow: none;
}

html[dir="rtl"] .qs-sg-loc-select {
    padding: 0 0 0 28px;
}

.qs-sg-loc-chev {
    position: absolute;
    right: 4px;
    bottom: 12px;
    pointer-events: none;
    color: #1A1A1A;
}

html[dir="rtl"] .qs-sg-loc-chev {
    right: auto;
    left: 4px;
}

/* cm / inches */
.qs-sg-units {
    display: flex;
    gap: 28px;
    margin-top: 20px;
}

.qs-sg-unit {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0;
    text-transform: none;
    color: #1A1A1A;
    cursor: pointer;
}

.qs-sg-radio {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid #1A1A1A;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qs-sg-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1A1A1A;
    opacity: 0;
}

.qs-sg-unit[aria-checked="true"] .qs-sg-radio::after {
    opacity: 1;
}

/* Charts */
.qs-sg-table {
    margin-top: 16px;
}

.qs-sg-tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 8px;
    align-items: center;
    min-height: 40px;
    padding: 5px 10px;
    font-size: 13px;
    line-height: normal;
    color: #1A1A1A;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.qs-sg-table--3 .qs-sg-tr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qs-sg-table--wrist .qs-sg-tr {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
}

.qs-sg-tr > span {
    min-width: 0;
}

/* The design's cells hold the value and a 2px gap under it */
.qs-sg-tr:not(.qs-sg-thead) > span {
    padding-bottom: 2px;
}

.qs-sg-thead {
    min-height: 48px;
    padding: 6px 10px;
    background: #D4D4D4;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.qs-sg-tr:not(.qs-sg-thead):nth-child(even) {
    background: #F4F4F4;
}

.qs-sg-tr:not(.qs-sg-thead):nth-child(odd) {
    background: #FFFFFF;
}

/* Marks: the selected size, sizes the ring has sold out */
.qs-sg-tr.is-soldout {
    color: #B5B5B5;
}

.qs-sg-tr.is-selected {
    background: #E4E4E4 !important;
    font-weight: 600;
}

.qs-sg-tr.is-selected::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: #1A1A1A;
}

html[dir="rtl"] .qs-sg-tr.is-selected::before {
    left: auto;
    right: 0;
}

/* The Shoes menu's guide: rows to pick */
.qs-sg-layer.is-pick .qs-sg-tr:not(.qs-sg-thead) {
    cursor: pointer;
}

.qs-sg-table[data-chart],
.qs-sg-table-note[data-chart] {
    display: none;
}

.qs-sg-layer[data-chart="pm"] .qs-sg-table[data-chart="pm"],
.qs-sg-layer[data-chart="num"] .qs-sg-table[data-chart="num"],
.qs-sg-layer[data-chart="letter"] .qs-sg-table[data-chart="letter"],
.qs-sg-layer[data-chart="letter"] .qs-sg-table-note[data-chart="letter"] {
    display: block;
}

.qs-sg-table-note {
    margin-top: 12px !important;
    font-size: 12px;
    line-height: 1.55;
    color: #6F6F6F;
}

.qs-sg-foot {
    margin-top: 14px !important;
    font-size: 12px;
    line-height: 1.6;
    color: #6F6F6F;
}

/* Measurement guide */
.qs-sg-fit {
    font-family: var(--qs-font-heading, 'Cormorant Garamond', 'IBM Plex Sans Arabic', serif);
    font-size: 22px;
    line-height: 1.25;
    color: #1A1A1A;
}

.qs-sg-intro {
    margin: 6px 0 4px !important;
    font-size: 13px;
    line-height: 1.6;
    color: #4A4A4A;
}

.qs-sg-subtitle {
    margin-top: 18px;
    font-size: 15px;
    font-weight: 600;
    line-height: normal;
    color: #1A1A1A;
}

.qs-sg-steps {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qs-sg-steps li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.qs-sg-step-no {
    flex: 0 0 22px;
    font-family: var(--qs-font-heading, 'Cormorant Garamond', 'IBM Plex Sans Arabic', serif);
    font-size: 28px;
    line-height: 1;
    color: #B5B5B5;
}

.qs-sg-steps li > span:last-child {
    font-size: 14px;
    line-height: 1.55;
    color: #1A1A1A;
}

.qs-sg-after {
    margin-top: 20px !important;
    font-size: 13px;
    line-height: 1.6;
    color: #1A1A1A;
}

.qs-sg-tip {
    margin-top: 20px !important;
    font-size: 12px;
    line-height: 1.6;
    color: #6F6F6F;
}

.qs-sg-figure {
    margin-top: 20px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Watch size guide blocks (inc/core/watch-size-guides.php): a picture at the height set
   in the admin (desktop and phones alike, as the design), a table with any number of
   columns, a Paragraph and a Note text, and a heading after a table further down */
.qs-sg-figure.qs-sg-figure--own {
    height: var(--qs-sg-figure-h, 250px);
}

.qs-sg-table--own .qs-sg-tr {
    grid-template-columns: repeat(var(--qs-sg-cols, 2), minmax(0, 1fr));
}

.qs-sg-table + .qs-sg-subtitle {
    margin-top: 34px;
}

.qs-sg-text {
    margin: 2px 0 0 !important;
    font-size: 13px;
    line-height: 1.6;
    color: #4A4A4A;
}

.qs-sg-lead {
    margin: 2px 0 0 !important;
    font-size: 13px;
    line-height: normal;
    color: #4A4A4A;
}

.qs-sg-figure img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

/* Need help finding your size? */
.qs-sg-help {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #EFECE7;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.qs-sg-help-title {
    font-size: 15px;
    font-weight: 600;
    line-height: normal;
    color: #1A1A1A;
}

.qs-sg-help-text {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.6;
    color: #4A4A4A;
}

.qs-sg-wa {
    margin-top: 18px;
    height: 48px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #1A1A1A;
    border-radius: 2px;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: normal;
    letter-spacing: 0;
    text-transform: none;
    color: #1A1A1A !important;
    text-decoration: none !important;
}

.qs-sg-wa svg {
    flex-shrink: 0;
}

/* Shop size N (Shoes menu) */
.qs-sg-cta-bar {
    flex-shrink: 0;
    padding: 16px 28px 26px;
    border-top: 1px solid #E0E0E0;
    background: #FFFFFF;
}

.qs-sg-cta-bar[hidden] {
    display: none;
}

.qs-sg-cta {
    width: 100%;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 2px;
    background: #000000;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: normal;
    color: #FFFFFF !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 200ms ease;
}

.qs-sg-cta[aria-disabled="true"] {
    background: #E6E6E6;
    color: #9A9A9A !important;
    cursor: not-allowed;
}

/* Keyboard focus */
.qs-sg-close:focus-visible,
.qs-sg-tab:focus-visible,
.qs-sg-unit:focus-visible,
.qs-sg-wa:focus-visible,
.qs-sg-loc-select:focus-visible {
    outline: 2px solid #1A1A1A;
    outline-offset: 2px;
}

.qs-sg-tr:focus-visible,
.qs-sg-cta:focus-visible {
    outline: 2px solid #1A1A1A;
    outline-offset: -2px;
}

/* The page behind an open guide does not scroll */
html.qs-sg-lock,
html.qs-sg-lock body {
    overflow: hidden !important;
}

/* Phones and tablets: a sheet from the bottom */
@media (max-width: 1023px) {
    .qs-sg,
    html[dir="rtl"] .qs-sg {
        top: max(64px, calc(100% - 544px));
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        border-radius: 16px 16px 0 0;
        overflow: hidden;
        box-shadow: 0 -2px 16px rgba(26, 26, 26, 0.10);
        transform: translateY(100%);
    }

    .qs-sg-handle {
        flex-shrink: 0;
        display: flex;
        justify-content: center;
        padding-top: 8px;
    }

    .qs-sg-handle span {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: #D9D4CC;
    }

    .qs-sg-head,
    html[dir="rtl"] .qs-sg-head {
        height: 64px;
        padding: 0 20px;
    }

    .qs-sg-tabs {
        padding-top: 14px;
    }

    .qs-sg-tab {
        font-size: 16px;
    }

    .qs-sg-body {
        padding: 20px 20px 28px;
    }

    .qs-sg-fit {
        font-size: 20px;
    }

    .qs-sg-figure {
        height: 220px;
    }

    .qs-sg-figure.qs-sg-figure--own {
        height: var(--qs-sg-figure-h, 250px);
    }

    .qs-sg-cta-bar {
        padding: 16px 20px 24px;
    }
}

/* "Size Guide" on the product page, at the end of the Size row */
.qs-size-guide-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin: -8px 0 2px auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-family: inherit;
    font-size: 13px !important;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #1A1A1A;
    cursor: pointer;
}

html[dir="rtl"] .qs-size-guide-link {
    margin: -8px auto 2px 0;
}

.qs-size-guide-link:hover {
    color: #2D1F1F;
}

.qs-size-guide-link:focus-visible {
    outline: 2px solid #2D1F1F;
    outline-offset: 3px;
}

.qs-size-guide-link[hidden] {
    display: none;
}

/* A product without sizes (a bracelet, a shoe): the Size row holds the link alone (js/product-page.js) */
#size-selector.size-selector--guide-only .selector-label,
#size-selector.size-selector--guide-only .size-options,
#size-selector.size-selector--guide-only #size-error {
    display: none !important;
}

#size-selector.size-selector--guide-only .selector-label-row {
    min-height: 24px;
}

@media (max-width: 1023px) {
    .qs-size-guide-link {
        min-height: 44px;
        margin-top: -14px;
        margin-bottom: -4px;
    }
}
