/*
 * WeSolve_OutOfStockNotifications - subscribe drawer / bottom sheet (popup.phtml)
 * Desktop (md+): right drawer 480px. Mobile: bottom sheet.
 */
#wesolve-oos-popup > .oos-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 768px) {
    #wesolve-oos-popup > .oos-overlay {
        align-items: stretch;
        justify-content: flex-end;
    }
}

.oos-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgb(0 0 0 / 0.2);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    cursor: pointer;
}

/* Drawer / sheet */
.oos-drawer {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    background: #fff;
    color: #111;
    outline: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgb(0 0 0 / 0.18);
}

@media (min-width: 768px) {
    .oos-drawer {
        width: 480px;
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        box-shadow: -8px 0 32px rgb(0 0 0 / 0.18);
    }
}

.oos-handle {
    display: block;
    flex: 0 0 auto;
    width: 40px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 999px;
    background: #d4d4d4;
}

@media (min-width: 768px) {
    .oos-handle {
        display: none;
    }
}

/* Header */
.oos-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 64px;
    padding: 0 20px;
    border-bottom: 1px solid #000;
}

@media (min-width: 768px) {
    .oos-header {
        height: 80px;
        padding: 0 32px;
    }
}

.oos-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.3;
    color: #111;
}

.oos-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: -8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;
    cursor: pointer;
}

.oos-close:hover,
.oos-close:focus-visible {
    background: #f5f5f5;
    outline: none;
}

.oos-icon {
    width: 20px;
    height: 20px;
}

.oos-icon-sm {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin-top: 1px;
}

/* Body */
.oos-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
    .oos-body {
        padding: 32px;
    }
}

/* Product card */
.oos-product {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.oos-product[style*="display: none"] {
    display: none;
}

.oos-product-thumb {
    flex: 0 0 96px;
    width: 96px;
    height: 128px;
    overflow: hidden;
    background: #f5f5f5;
}

.oos-product-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.oos-product-info {
    min-width: 0;
    flex: 1 1 auto;
}

.oos-product-name {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    color: #111;
}

.oos-product-prices {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 6px 0 0;
    font-size: 0.8125rem;
}

.oos-product-prices[style*="display: none"] {
    display: none;
}

.oos-price {
    font-weight: 600;
    color: #111;
}

.oos-price.is-sale {
    color: #e10000;
}

.oos-price-old {
    color: #737373;
    text-decoration: line-through;
}

.oos-product-meta {
    margin: 8px 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
}

.oos-product-meta > div {
    display: flex;
    gap: 0.5rem;
    margin-top: 2px;
}

.oos-product-meta > div[style*="display: none"] {
    display: none;
}

.oos-product-meta dt {
    min-width: 4.25rem;
    color: #737373;
}

.oos-product-meta dd {
    margin: 0;
    font-weight: 500;
    color: #111;
}

.oos-divider {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #e5e5e5;
}

/* Form */
.oos-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.oos-subtitle {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #404040;
}

.oos-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.oos-field[style*="display: none"] {
    display: none;
}

.oos-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #111;
}

.oos-input {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d4d4d4;
    border-radius: 0;
    background: #fff;
    font-size: 0.875rem;
    color: #111;
}

.oos-input::placeholder {
    color: #737373;
}

.oos-input:focus,
.oos-input:focus-visible {
    border-color: #000;
    outline: none;
    box-shadow: 0 0 0 1px #000;
}

.oos-note {
    margin: 0;
    font-size: 0.8125rem;
    color: #525252;
}

.oos-error {
    margin: 0;
    font-size: 0.8125rem;
    color: #e10000;
}

.oos-submit,
.oos-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    border: 1px solid #000;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.oos-submit {
    background: #000;
    color: #fff;
}

.oos-submit:hover,
.oos-submit:focus-visible {
    background: #262626;
    border-color: #262626;
    outline: none;
}

.oos-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.oos-continue {
    background: #fff;
    color: #000;
}

.oos-continue:hover,
.oos-continue:focus-visible {
    background: #000;
    color: #fff;
    outline: none;
}

.oos-disclaimer,
.oos-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.5;
    color: #525252;
    cursor: default;
}

.oos-consent {
    cursor: pointer;
}

.oos-consent-text {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.oos-consent a,
.oos-disclaimer a {
    color: #1d4ed8;
    text-decoration: underline;
}

.oos-checkbox {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    accent-color: #000;
}

/* Success */
.oos-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
    text-align: center;
}

.oos-success[style*="display: none"] {
    display: none;
}

.oos-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-top: 8px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #059669;
}

.oos-success-icon .oos-icon {
    width: 24px;
    height: 24px;
}

.oos-success-title {
    margin: 8px 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111;
}

.oos-success-text {
    margin: 0 0 12px;
    max-width: 28rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #525252;
}

/* Alpine transitions: backdrop fade, slide from right (desktop) / slide up (mobile) */
.oos-fade-enter {
    transition: opacity 200ms ease-out;
}

.oos-fade-leave {
    transition: opacity 150ms ease-in;
}

.oos-fade-hidden {
    opacity: 0;
}

.oos-fade-shown {
    opacity: 1;
}

.oos-drawer-enter {
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.oos-drawer-leave {
    transition: transform 200ms ease-in;
}

.oos-drawer-hidden {
    transform: translateY(100%);
}

.oos-drawer-shown {
    transform: none;
}

@media (min-width: 768px) {
    .oos-drawer-hidden {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .oos-fade-enter,
    .oos-fade-leave,
    .oos-drawer-enter,
    .oos-drawer-leave {
        transition-duration: 1ms;
    }
}
