/* THS Add-On Popup — "Make It Extra Special!"
   Styled in The Hamper Story's brand: gold #b3821c, charcoal #1c1c1a,
   Montserrat for text and Cormorant Garamond for the heading.
   Every rule is scoped to .ths-ap and selectors are doubled
   (.ths-ap .ths-ap__x) so theme / Elementor styles don't leak in.
   Size: the popup uses about 65% of the screen width on desktop. */

html.ths-ap-open,
html.ths-ap-open body {
    overflow: hidden !important;
}

.ths-ap {
    --ths-ap-accent: #b3821c;
    --ths-ap-accent-dark: color-mix(in srgb, var(--ths-ap-accent) 82%, #000);
    --ths-ap-accent-tint: color-mix(in srgb, var(--ths-ap-accent) 9%, #fff);
    --ths-ap-dark: #1c1c1a;
    --ths-ap-text: #2b2b2b;
    --ths-ap-muted: #8a8a86;
    --ths-ap-line: #ecebe7;
    --ths-ap-soft: #faf8f4;
    --ths-ap-error: #b42318;
    --ths-ap-font: Montserrat, "Helvetica Neue", Arial, sans-serif;
    --ths-ap-heading-font: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --ths-ap-width: 65vw;

    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    font-family: var(--ths-ap-font);
    color: var(--ths-ap-text);
    line-height: 1.35;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    visibility: hidden;
    opacity: 0;
    transition: opacity .22s ease, visibility 0s linear .22s;
}

.ths-ap *,
.ths-ap *::before,
.ths-ap *::after {
    box-sizing: border-box;
}

.ths-ap.is-visible {
    visibility: visible;
    opacity: 1;
    transition: opacity .22s ease;
}

.ths-ap .ths-ap__overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 28, 26, .62);
    cursor: pointer;
}

.ths-ap .ths-ap__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: var(--ths-ap-width);
    min-width: 720px;
    max-width: 1180px;
    max-height: 82vh;
    max-height: 82dvh;
    margin: 0;
    background: #fff;
    border-radius: 10px;
    border-top: 3px solid var(--ths-ap-accent);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
    overflow: hidden;
    transform: translateY(14px) scale(.985);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}

.ths-ap.is-visible .ths-ap__panel {
    transform: none;
}

/* ---------- header ---------- */

.ths-ap .ths-ap__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px 14px 24px;
    border-bottom: 1px solid var(--ths-ap-line);
}

.ths-ap .ths-ap__title {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ths-ap-dark);
    font-family: var(--ths-ap-heading-font);
    font-size: 31px;
    font-weight: 500;
    font-style: normal;
    line-height: 1.15;
    letter-spacing: 0;
    text-transform: none;
}

.ths-ap .ths-ap__heading {
    min-width: 0;
}

.ths-ap .ths-ap__subtitle {
    margin: 4px 0 0;
    padding: 0;
    overflow: hidden;
    color: var(--ths-ap-text);
    font-family: var(--ths-ap-font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ths-ap .ths-ap__subtitle[hidden] {
    display: none;
}

.ths-ap .ths-ap__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ths-ap-dark);
    border-radius: 50%;
    background: #fff;
    box-shadow: none;
    color: var(--ths-ap-dark);
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.ths-ap .ths-ap__close:hover,
.ths-ap .ths-ap__close:focus-visible {
    border-color: var(--ths-ap-accent);
    background: var(--ths-ap-accent);
    color: #fff;
}

.ths-ap .ths-ap__close svg {
    display: block;
}

/* ---------- main area ---------- */

.ths-ap .ths-ap__main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ---------- category tabs ---------- */

.ths-ap .ths-ap__tabs {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin: 0;
    padding: 14px 24px 0;
    border-bottom: 1px solid var(--ths-ap-line);
    background: var(--ths-ap-soft);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d9d5cc transparent;
    -webkit-overflow-scrolling: touch;
}

.ths-ap .ths-ap__tabs::-webkit-scrollbar {
    height: 6px;
}

.ths-ap .ths-ap__tabs::-webkit-scrollbar-thumb {
    background: #d9d5cc;
    border-radius: 6px;
}

.ths-ap .ths-ap__tabs::-webkit-scrollbar-track {
    background: transparent;
}

.ths-ap .ths-ap__tab {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 54px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0 2px 13px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--ths-ap-text);
    font-family: var(--ths-ap-font);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s ease;
}

.ths-ap .ths-ap__tab:hover,
.ths-ap .ths-ap__tab:focus {
    background: none;
    color: var(--ths-ap-accent);
}

.ths-ap .ths-ap__tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
    transition: background-color .15s ease;
}

.ths-ap .ths-ap__tab.is-active {
    color: var(--ths-ap-accent);
}

.ths-ap .ths-ap__tab.is-active::after {
    background: var(--ths-ap-accent);
}

.ths-ap .ths-ap__tab-icon {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 0 8px;
    padding: 2px;
    border: 1.5px solid var(--ths-ap-line);
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    transition: border-color .15s ease;
}

.ths-ap .ths-ap__tab:hover .ths-ap__tab-icon,
.ths-ap .ths-ap__tab.is-active .ths-ap__tab-icon {
    border-color: var(--ths-ap-accent);
}

.ths-ap .ths-ap__tab-icon img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: none;
}

.ths-ap .ths-ap__tab-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--ths-ap-accent-tint);
    color: var(--ths-ap-accent);
    transition: background-color .15s ease, color .15s ease;
}

.ths-ap .ths-ap__tab-svg svg {
    display: block;
    width: 24px;
    height: 24px;
}

.ths-ap .ths-ap__tab.is-active .ths-ap__tab-svg {
    background: var(--ths-ap-accent);
    color: #fff;
}

.ths-ap .ths-ap__tab-fallback {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--ths-ap-accent-tint);
}

.ths-ap .ths-ap__tab-label {
    display: block;
}

/* ---------- product grid ---------- */

.ths-ap .ths-ap__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d9d5cc transparent;
}

.ths-ap .ths-ap__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    column-gap: 20px;
    row-gap: 26px;
    margin: 0;
    padding: 22px 24px 26px;
    list-style: none;
}

.ths-ap .ths-ap__card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    background: none;
}

.ths-ap .ths-ap__card[hidden] {
    display: none;
}

.ths-ap .ths-ap__card::before,
.ths-ap .ths-ap__card::marker {
    content: none;
}

.ths-ap .ths-ap__media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 0;
    border-radius: 8px;
    background: var(--ths-ap-soft);
    overflow: hidden;
}

.ths-ap .ths-ap__media img,
.ths-ap .ths-ap__img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    box-shadow: none;
    transition: transform .35s ease;
}

.ths-ap .ths-ap__card:hover .ths-ap__media img {
    transform: scale(1.04);
}

.ths-ap .ths-ap__name {
    display: -webkit-box;
    min-height: 2.4em;
    margin: 12px 0 0;
    overflow: hidden;
    color: var(--ths-ap-dark);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ths-ap .ths-ap__row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 8px;
}

.ths-ap .ths-ap__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 7px;
    row-gap: 1px;
    min-width: 0;
}

.ths-ap .ths-ap__now {
    color: var(--ths-ap-dark);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.ths-ap .ths-ap__suffix {
    color: var(--ths-ap-dark);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.ths-ap .ths-ap__was {
    color: var(--ths-ap-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: line-through;
    white-space: nowrap;
    opacity: 1;
}

.ths-ap .ths-ap__now .amount,
.ths-ap .ths-ap__was .amount,
.ths-ap .ths-ap__now bdi,
.ths-ap .ths-ap__was bdi {
    color: inherit;
    font: inherit;
    text-decoration: inherit;
}

/* ADD button and quantity stepper share one slot. */
.ths-ap .ths-ap__action {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    height: 40px;
}

.ths-ap .ths-ap__add,
.ths-ap .ths-ap__stepper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: .8px solid var(--ths-ap-accent);
    border-radius: 4px;
    background: var(--ths-ap-accent);
    box-shadow: none;
    color: #fff;
    font-family: var(--ths-ap-font);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .5px;
    text-transform: uppercase;
    text-decoration: none;
}

.ths-ap .ths-ap__add {
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.ths-ap .ths-ap__add:hover,
.ths-ap .ths-ap__add:focus-visible {
    border-color: var(--ths-ap-accent-dark);
    background: var(--ths-ap-accent-dark);
    color: #fff;
}

.ths-ap .ths-ap__stepper {
    display: none;
    justify-content: space-between;
    background: var(--ths-ap-accent);
    color: #fff;
    letter-spacing: 0;
}

.ths-ap .ths-ap__action.has-qty .ths-ap__add {
    display: none;
}

.ths-ap .ths-ap__action.has-qty .ths-ap__stepper {
    display: flex;
}

.ths-ap .ths-ap__step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #fff;
    font-family: var(--ths-ap-font);
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.ths-ap .ths-ap__step:hover,
.ths-ap .ths-ap__step:focus {
    background: rgba(0, 0, 0, .12);
    color: #fff;
}

.ths-ap .ths-ap__step:disabled {
    opacity: .45;
    cursor: default;
}

.ths-ap .ths-ap__qty {
    flex: 1 1 auto;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.ths-ap .ths-ap__action.is-busy {
    pointer-events: none;
}

/* While saving: the slot turns solid gold with three bouncing white dots. */
.ths-ap .ths-ap__action.is-busy .ths-ap__add,
.ths-ap .ths-ap__action.is-busy .ths-ap__stepper {
    background: var(--ths-ap-accent);
    color: transparent;
}

.ths-ap .ths-ap__action.is-busy .ths-ap__step {
    color: transparent;
}

.ths-ap .ths-ap__dots {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    pointer-events: none;
}

.ths-ap .ths-ap__action.is-busy .ths-ap__dots,
.ths-ap .ths-ap__continue.is-loading .ths-ap__dots {
    display: flex;
}

.ths-ap .ths-ap__continue.is-loading {
    position: relative;
    background: var(--ths-ap-accent);
    color: #fff;
    cursor: progress;
}

.ths-ap .ths-ap__dots i {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: ths-ap-bounce 1s infinite ease-in-out both;
}

.ths-ap .ths-ap__dots i:nth-child(1) { animation-delay: -.32s; }
.ths-ap .ths-ap__dots i:nth-child(2) { animation-delay: -.16s; }

@keyframes ths-ap-bounce {
    0%, 80%, 100% { transform: scale(.45); opacity: .55; }
    40%           { transform: scale(1);   opacity: 1; }
}

@keyframes ths-ap-spin {
    to { transform: rotate(360deg); }
}

.ths-ap .ths-ap__msg {
    margin: 6px 0 0;
    color: var(--ths-ap-muted);
    font-size: 11.5px;
    line-height: 1.35;
}

.ths-ap .ths-ap__msg:empty {
    display: none;
}

.ths-ap .ths-ap__msg.is-error {
    color: var(--ths-ap-error);
}

.ths-ap .ths-ap__empty {
    margin: 0;
    padding: 40px 24px;
    color: var(--ths-ap-muted);
    text-align: center;
}

.ths-ap .ths-ap__empty[hidden] {
    display: none;
}

/* ---------- footer ---------- */

.ths-ap .ths-ap__footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    padding: 12px 24px;
    border-top: 1px solid var(--ths-ap-line);
    background: #fff;
}

.ths-ap .ths-ap__continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 280px;
    max-width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 20px;
    border: .8px solid var(--ths-ap-accent);
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    color: var(--ths-ap-accent);
    font-family: var(--ths-ap-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.ths-ap .ths-ap__continue:hover,
.ths-ap .ths-ap__continue:focus-visible,
.ths-ap .ths-ap__continue.is-primary {
    background: var(--ths-ap-accent);
    color: #fff;
}

.ths-ap .ths-ap__continue.is-primary:hover,
.ths-ap .ths-ap__continue.is-primary:focus-visible {
    border-color: var(--ths-ap-accent-dark);
    background: var(--ths-ap-accent-dark);
}

.ths-ap button:focus-visible {
    outline: 2px solid var(--ths-ap-accent);
    outline-offset: 2px;
}

/* ---------- smaller laptops / tablets ---------- */

@media (max-width: 1180px) {
    .ths-ap .ths-ap__panel {
        width: 85vw;
        min-width: 0;
    }
}

/* ---------- mobile: bottom sheet ---------- */

@media (max-width: 767px) {
    .ths-ap {
        align-items: flex-end;
        padding: 0;
    }

    .ths-ap .ths-ap__panel {
        width: 100%;
        max-width: none;
        max-height: 88vh;
        max-height: 88dvh;
        border-radius: 14px 14px 0 0;
        transform: translateY(40px);
    }

    .ths-ap .ths-ap__header {
        padding: 14px 16px 12px;
    }

    .ths-ap .ths-ap__title {
        font-size: 26px;
    }

    .ths-ap .ths-ap__tabs {
        gap: 18px;
        padding: 12px 16px 0;
        scrollbar-width: none;
    }

    .ths-ap .ths-ap__tabs::-webkit-scrollbar {
        display: none;
    }

    .ths-ap .ths-ap__tab {
        min-width: 46px;
        padding-bottom: 10px;
        font-size: 10.5px;
        letter-spacing: .5px;
    }

    .ths-ap .ths-ap__tab-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 6px;
    }

    .ths-ap .ths-ap__tab-svg svg {
        width: 21px;
        height: 21px;
    }

    .ths-ap .ths-ap__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 20px;
        padding: 16px 16px 20px;
    }

    .ths-ap .ths-ap__name {
        margin-top: 8px;
        font-size: 14px;
    }

    .ths-ap .ths-ap__now {
        font-size: 14px;
    }

    .ths-ap .ths-ap__action {
        height: 38px;
    }

    .ths-ap .ths-ap__footer {
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .ths-ap .ths-ap__continue {
        width: 100%;
        height: 46px;
    }
}

@media (max-width: 360px) {
    .ths-ap .ths-ap__row {
        flex-direction: column;
        align-items: stretch;
    }
    .ths-ap .ths-ap__action {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ths-ap,
    .ths-ap .ths-ap__panel,
    .ths-ap .ths-ap__media img {
        transition: none;
    }
}
