/* assets/css/upsell-popup.css */

body.yspp-popup-open {
    overflow: hidden;
}

.yspp-popup-overlay * {
    box-sizing: border-box;
}

.yspp-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.yspp-popup-overlay.yspp-active {
    opacity: 1;
    visibility: visible;
}

.yspp-popup-dialog {
    position: relative;
    width: min(840px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
    transform: translateY(18px) scale(0.985);
    transition: transform 180ms ease, opacity 180ms ease;
}

.yspp-popup-overlay.yspp-active .yspp-popup-dialog {
    transform: translateY(0) scale(1);
}

.yspp-popup-dialog.is-closing {
    transform: translateY(16px) scale(0.985);
    opacity: 0.7;
}

.yspp-popup-close {
    position: absolute !important;
    top: 24px !important;
    right: 24px !important;
    z-index: 4 !important;
    width: 32px !important;
    height: 32px !important;
    border: 0 !important;
    background: transparent !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 160ms ease, transform 160ms ease !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.yspp-popup-close:hover {
    color: #111827 !important;
    transform: scale(1.04) !important;
}

.yspp-popup-close svg {
    width: 20px;
    height: 20px;
}

.yspp-popup-header {
    padding: 24px 32px 16px;
}

.yspp-popup-title-wrap {
    padding-right: 64px;
}

.yspp-popup-title {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    color: #1f2937;
}

.yspp-popup-subtitle {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #6b7280;
}

.yspp-popup-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 32px;
    background: #f4f7fc;
}

.yspp-popup-summary-left,
.yspp-popup-summary-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.yspp-popup-summary-copy {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.yspp-popup-summary-copy strong {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.yspp-popup-summary-copy span {
    font-size: 15px;
    color: #9ca3af;
}

.yspp-popup-cart-icon {
    width: 20px;
    height: 20px;
    color: #3b82f6;
    flex: 0 0 auto;
}

.yspp-popup-cart-icon svg {
    width: 100%;
    height: 100%;
}

.yspp-popup-summary-total {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.yspp-popup-view-cart {
    font-size: 15px;
    font-weight: 500;
    color: #3b82f6;
    text-decoration: none;
}

.yspp-popup-view-cart:hover {
    text-decoration: underline;
}

.yspp-popup-message {
    margin: 16px 32px 0;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 500;
}

.yspp-popup-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px 32px;
    background: #ffffff;
}

.yspp-popup-body::-webkit-scrollbar {
    width: 8px;
}

.yspp-popup-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
    border: 2px solid #ffffff;
}

.yspp-popup-product {
    display: grid;
    grid-template-columns: 24px 64px minmax(0, 1fr) 100px 110px;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    transition: border-color 160ms ease;
}

.yspp-popup-product:last-child {
    margin-bottom: 0;
}

.yspp-popup-product.is-selected {
    border-color: #d1d5db;
}

.yspp-popup-checkbox {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    border-radius: 6px !important;
    border: 1px solid #d1d5db !important;
    background: #ffffff !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 160ms ease !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.yspp-popup-product.is-selected .yspp-popup-checkbox {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.yspp-popup-checkbox:hover {
    transform: scale(1.05) !important;
}

.yspp-popup-checkmark {
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
}

.yspp-popup-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yspp-popup-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.yspp-popup-product-main {
    border: 0 !important;
    background: transparent !important;
    text-align: left !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.yspp-popup-product-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.yspp-popup-product-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    color: #111827;
}

.yspp-popup-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #e11d48;
    background: #ffe4e6;
    white-space: nowrap;
}

.yspp-popup-product-save {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #3b82f6;
}

.yspp-popup-pricing {
    min-width: 80px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.yspp-popup-product-price {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.yspp-popup-product-regular {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    text-decoration: line-through;
    margin-top: 2px;
}

.yspp-popup-quantity {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 90px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    justify-self: end;
}

.yspp-popup-qty-btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #6b7280 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.yspp-popup-qty-btn:hover {
    color: #111827 !important;
    background: #f3f4f6 !important;
}

.yspp-popup-qty-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    min-width: 20px;
    text-align: center;
}

.yspp-popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 32px 20px;
    border-top: 1px solid #f3f4f6;
    background: #ffffff;
}

.yspp-popup-footer-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.yspp-popup-footer-count {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.yspp-popup-footer-save {
    font-size: 14px;
    color: #6b7280;
}

.yspp-popup-footer-save strong {
    color: #16a34a;
    font-weight: 600;
}

.yspp-popup-footer-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.yspp-popup-skip {
    border: 0 !important;
    background: transparent !important;
    color: #6b7280 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    padding: 8px !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: color 150ms ease !important;
}

.yspp-popup-skip:hover {
    color: #374151 !important;
}

.yspp-popup-add {
    min-width: 140px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 150ms ease, transform 150ms ease;
}

.yspp-popup-add:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.yspp-popup-add:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .yspp-popup-dialog {
        width: calc(100vw - 32px);
    }

    .yspp-popup-header,
    .yspp-popup-summary,
    .yspp-popup-body,
    .yspp-popup-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .yspp-popup-product {
        grid-template-columns: 24px 56px minmax(0, 1fr);
        grid-template-areas:
            "checkbox thumb info"
            ". pricing pricing"
            ". quantity quantity";
        align-items: start;
        row-gap: 12px;
    }

    .yspp-popup-checkbox { grid-area: checkbox; }
    .yspp-popup-thumb { grid-area: thumb; width: 56px; height: 56px; }
    .yspp-popup-product-main { grid-area: info; }
    .yspp-popup-pricing { 
        grid-area: pricing; 
        text-align: left; 
        align-items: flex-start;
        flex-direction: row;
        gap: 8px;
    }
    .yspp-popup-quantity { grid-area: quantity; justify-self: start; }
    
    .yspp-popup-product-regular {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .yspp-popup-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .yspp-popup-footer-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }

    .yspp-popup-skip {
        text-align: center;
        order: 2;
    }

    .yspp-popup-add {
        width: 100%;
        order: 1;
    }
}
