/**
 * Shoptrangsuc Product Sticky + Recently Viewed
 * Component-only CSS. Loaded only on PDP/product archive contexts.
 */

body.st-product-sticky-visible {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
}

.st-product-sticky-panel {
    position: fixed;
    z-index: 9999;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    visibility: hidden;
    opacity: 0;
    transform: translateY(calc(100% + 12px));
    pointer-events: none;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid rgba(128, 103, 68, .14);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -10px 28px rgba(28, 28, 26, .08);
    backdrop-filter: blur(14px);
    transition: transform .2s ease, opacity .18s ease, visibility 0s linear .2s;
}

.st-product-sticky-panel.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}

.st-product-sticky-panel__inner {
    display: grid;
    align-items: center;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 7px 6px 6px;
}

.st-product-sticky-panel--product .st-product-sticky-panel__inner {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.st-product-sticky-panel--archive .st-product-sticky-panel__inner {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.st-product-sticky-panel .st-product-sticky-panel__item {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 62px;
    margin: 0;
    padding: 7px 4px;
    border: 0 !important;
    border-radius: 10px;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--st-text, #3a3936) !important;
    font: inherit !important;
    font-size: 11.75px !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
    text-align: center;
    text-decoration: none !important;
    text-transform: none !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color .15s ease, background-color .15s ease, transform .12s ease, box-shadow .15s ease;
}

.st-product-sticky-panel .st-product-sticky-panel__item:hover,
.st-product-sticky-panel .st-product-sticky-panel__item:focus-visible {
    background: rgba(248, 248, 248, .95) !important;
    color: var(--st-text-strong, #111) !important;
}

body.st-has-applied-filters
.st-product-sticky-panel--archive
.st-product-sticky-panel__item[data-st-action="filter"],
body.st-has-applied-filters
.st-product-sticky-panel--archive
.st-product-sticky-panel__item[data-st-action="filter"]:hover,
body.st-has-applied-filters
.st-product-sticky-panel--archive
.st-product-sticky-panel__item[data-st-action="filter"]:focus-visible {
    align-self: center;
    min-height: 54px;
    margin: 4px 6px;
    padding: 6px;
    border-radius: 12px;
    background: var(--st-primary, #1C1C1A) !important;
    color: var(--st-white, #fff) !important;
    box-shadow: 0 9px 22px rgba(28, 28, 26, .16) !important;
}

.st-product-sticky-panel .st-product-sticky-panel__item:focus-visible,
.st-recent-drawer .st-recent-drawer__close:focus-visible {
    outline: 2px solid var(--st-secondary, #806744);
    outline-offset: 2px;
}

.st-product-sticky-panel .st-product-sticky-panel__item:active {
    transform: scale(.985);
}

.st-product-sticky-panel__icon {
    display: block;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
}

.st-product-sticky-panel__icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.st-product-sticky-panel__label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.st-product-sticky-panel .st-product-sticky-panel__add,
.st-product-sticky-panel .st-product-sticky-panel__add:hover,
.st-product-sticky-panel .st-product-sticky-panel__add:focus-visible,
.st-product-sticky-panel .st-product-sticky-panel__add:active {
    align-self: center;
    min-height: 54px;
    margin: 4px 6px;
    padding: 6px 6px;
    border-radius: 12px;
    background: var(--st-sale, #9b3a35) !important;
    color: var(--st-white, #fff) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    box-shadow: 0 10px 24px rgba(155, 58, 53, .20) !important;
}

body.st-recent-drawer-open {
    overflow: hidden;
}

.st-recent-drawer-backdrop {
    position: fixed;
    z-index: 10020;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    background: rgba(17, 17, 17, .30);
    transition: opacity .2s ease, visibility 0s linear .2s;
}

.st-recent-drawer-backdrop.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.st-recent-drawer {
    position: fixed;
    z-index: 10021;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(440px, calc(100vw - 24px));
    height: 100vh;
    height: 100dvh;
    visibility: hidden;
    overflow: hidden;
    transform: translateX(100%);
    background: var(--st-white, #fff);
    box-shadow: -12px 0 34px rgba(28, 28, 26, .11);
    transition: transform .24s ease, visibility 0s linear .24s;
}

.st-recent-drawer.is-open {
    visibility: visible;
    transform: translateX(0);
    transition-delay: 0s;
}

.st-recent-drawer__header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--st-divider, #e5e0d8);
    background: var(--st-white, #fff);
}

.st-recent-drawer__title {
    margin: 0;
    color: var(--st-text-strong, #111);
    font-size: 19px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
}

.st-recent-drawer .st-recent-drawer__close {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--st-text, #3a3936) !important;
}

.st-recent-drawer .st-recent-drawer__close:hover,
.st-recent-drawer .st-recent-drawer__close:focus-visible {
    background: var(--st-bg-soft, #f8f8f8) !important;
    color: var(--st-text-strong, #111) !important;
}

.st-recent-drawer__close svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.st-recent-drawer__body {
    height: calc(100% - 64px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px;
    -webkit-overflow-scrolling: touch;
}

.st-recent-drawer__state {
    margin: 18px 0;
    color: var(--st-text-soft, #5e5a54);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.st-recent-drawer__products {
    width: 100%;
}

.st-recent-drawer__products .products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
    width: 100%;
    margin: 0 !important;
}

/* Flatsome .row clearfix pseudo-elements become grid items otherwise. */
.st-recent-drawer__products .products::before,
.st-recent-drawer__products .products::after {
    display: none !important;
    content: none !important;
}

.st-recent-drawer__products .products > * {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.st-recent-drawer__products .box-text {
    padding-right: 2px;
    padding-left: 2px;
}

@media (max-width: 549px) {
    .st-recent-drawer {
        width: min(420px, calc(100vw - 16px));
    }

    .st-recent-drawer__header {
        min-height: 60px;
        padding: 11px 14px;
    }

    .st-recent-drawer__title {
        font-size: 18px;
    }

    .st-recent-drawer__body {
        height: calc(100% - 60px);
        padding: 14px;
    }

    .st-recent-drawer__products .products {
        gap: 18px 10px;
    }
}

@media (max-width: 374px) {
    .st-product-sticky-panel__inner {
        padding-right: 2px;
        padding-left: 2px;
    }

    .st-product-sticky-panel .st-product-sticky-panel__item {
        gap: 3px;
        padding-right: 2px;
        padding-left: 2px;
        font-size: 10.5px !important;
    }

    .st-product-sticky-panel__icon {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }

    .st-product-sticky-panel .st-product-sticky-panel__add {
        margin-right: 4px;
        margin-left: 4px;
    }
}

@media (min-width: 850px) {
    body.st-product-sticky-visible {
        padding-bottom: 96px;
    }

    .st-product-sticky-panel {
        right: auto;
        bottom: 22px;
        left: 50%;
        overflow: hidden;
        padding-bottom: 0;
        border: 1px solid rgba(128, 103, 68, .16);
        border-radius: 14px;
        box-shadow: 0 16px 42px rgba(28, 28, 26, .12);
        transform: translate(-50%, calc(100% + 32px));
    }

    .st-product-sticky-panel.is-visible {
        transform: translate(-50%, 0);
    }

    .st-product-sticky-panel--product {
        width: min(720px, calc(100% - 40px));
    }

    .st-product-sticky-panel--archive {
        width: min(600px, calc(100% - 40px));
    }

    .st-product-sticky-panel__inner {
        padding: 7px;
    }

    .st-product-sticky-panel .st-product-sticky-panel__item {
        min-height: 66px;
        font-size: 12px !important;
    }

    .st-product-sticky-panel__icon {
        width: 23px;
        height: 23px;
        flex-basis: 23px;
    }

    .st-product-sticky-panel .st-product-sticky-panel__add {
        min-height: 56px;
        margin: 4px 8px;
        font-size: 13px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .st-product-sticky-panel,
    .st-product-sticky-panel .st-product-sticky-panel__item,
    .st-recent-drawer,
    .st-recent-drawer-backdrop {
        transition: none;
    }
}
