/**
 * S&M Canada - Quick Checkout Modal Styles
 * Luxury Crisp Radius (Matching S&M Canada Sephora-style theme)
 * Dynamic color inheritance from Admin Settings (--sm-primary)
 */

.sm-quick-checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    padding: 16px;
    box-sizing: border-box;
}

.sm-quick-checkout-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Window Container - Sharp luxury radius */
.sm-quick-checkout-modal {
    background: var(--sm-main-bg, #ffffff);
    width: 100%;
    max-width: 530px;
    max-height: 90vh;
    border-radius: var(--sm-qc-radius, 3px);
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.97) translateY(6px);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-sizing: border-box;
}

.sm-quick-checkout-overlay.active .sm-quick-checkout-modal {
    transform: scale(1) translateY(0);
}

/* Header */
.sm-qc-header {
    position: relative;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
    text-align: center;
}

.sm-qc-title {
    font-size: 16px;
    font-weight: 700;
    color: #111111;
    margin: 0;
    padding: 0 34px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.sm-qc-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.sm-qc-close:hover {
    background: #e2e8f0;
    color: #000000;
    border-color: #cbd5e1;
}

.sm-qc-close i {
    font-family: feather !important;
    font-style: normal !important;
    font-weight: normal !important;
    font-size: 17px;
    line-height: 1;
    display: inline-block;
    speak: none;
}

/* Body / Scrollable Area */
.sm-qc-body {
    padding: 18px 20px 22px;
    overflow-y: auto;
    max-height: calc(90vh - 65px);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sm-qc-body::-webkit-scrollbar {
    width: 6px;
}

.sm-qc-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Form Groups */
.sm-qc-form-group {
    margin-bottom: 13px;
}

.sm-qc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

.sm-qc-required {
    color: #ef4444;
    font-weight: bold;
    margin-left: 2px;
}

.sm-qc-optional {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 400;
    margin-left: 4px;
}

/* Input Fields with Feather Left Icons */
.sm-qc-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sm-qc-input-icon {
    position: absolute;
    left: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: 16px;
}

.sm-qc-input-icon i {
    font-family: feather !important;
    font-style: normal !important;
    font-weight: normal !important;
    line-height: 1;
    display: inline-block;
    speak: none;
}

.sm-qc-pin-icon {
    top: 11px;
    align-items: flex-start;
}

.sm-qc-input,
.sm-qc-textarea {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-radius: var(--sm-qc-input-radius, 2px);
    padding: 9px 12px 9px 36px;
    font-size: 13.5px;
    color: #111111;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.sm-qc-textarea {
    resize: none;
    min-height: 52px;
    line-height: 1.45;
}

.sm-qc-notes-textarea {
    padding-left: 12px;
    min-height: 48px;
}

.sm-qc-input:focus,
.sm-qc-textarea:focus {
    background: #ffffff;
    border-color: var(--sm-primary, #FF6A00);
    box-shadow: 0 0 0 2px var(--sm-primary-border, rgba(255, 106, 0, 0.22));
}

.sm-qc-input.is-invalid,
.sm-qc-textarea.is-invalid {
    border-color: #ef4444;
    background: #fff5f5;
}

.sm-qc-error-hint {
    font-size: 11.5px;
    color: #ef4444;
    margin-top: 3px;
    display: none;
}

/* Shipping Method Selector Cards */
.sm-qc-shipping-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sm-qc-shipping-card {
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: #ffffff;
    padding: 9px 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sm-qc-shipping-card:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.sm-qc-shipping-card.active {
    border-color: var(--sm-primary, #FF6A00);
    background: var(--sm-primary-subtle, #fff7ed);
}

.sm-qc-shipping-label {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    cursor: pointer;
}

.sm-qc-shipping-radio {
    display: none;
}

.sm-qc-radio-custom {
    width: 17px;
    height: 17px;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.sm-qc-shipping-card.active .sm-qc-radio-custom {
    border-color: var(--sm-primary, #FF6A00);
    background: var(--sm-primary, #FF6A00);
}

.sm-qc-shipping-card.active .sm-qc-radio-custom::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background: #ffffff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sm-qc-shipping-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #111111;
    flex-grow: 1;
}

.sm-qc-shipping-price {
    font-size: 14px;
    font-weight: 700;
    color: #111111;
}

/* Payment Method Selector Cards */
.sm-qc-payment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sm-qc-payment-card {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.sm-qc-payment-card:hover {
    border-color: #94a3b8;
    background: #fbfbfc;
}

.sm-qc-payment-card.active {
    border-color: var(--sm-primary, #FF6A00);
    background: var(--sm-primary-subtle, #fff7ed);
    box-shadow: 0 0 0 1px var(--sm-primary, #FF6A00);
}

.sm-qc-payment-label {
    display: flex;
    align-items: flex-start;
    width: 100%;
    margin: 0;
    cursor: pointer;
}

.sm-qc-payment-radio {
    display: none;
}

.sm-qc-payment-card .sm-qc-radio-custom {
    margin-top: 2px;
}

.sm-qc-payment-card.active .sm-qc-radio-custom {
    border-color: var(--sm-primary, #FF6A00);
    background: var(--sm-primary, #FF6A00);
}

.sm-qc-payment-card.active .sm-qc-radio-custom::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background: #ffffff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sm-qc-payment-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sm-qc-payment-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sm-qc-payment-img {
    max-height: 20px;
    max-width: 55px;
    object-fit: contain;
    border-radius: 2px;
}

.sm-qc-payment-icon-fallback {
    font-size: 16px;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
}

.sm-qc-payment-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #111111;
}

.sm-qc-payment-badge {
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    background: var(--sm-primary, #FF6A00);
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.2;
    margin-left: 2px;
}

.sm-qc-payment-subtitle {
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.35;
}

.sm-qc-payment-card.active .sm-qc-payment-title {
    color: #111111;
}

.sm-qc-bank-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.sm-qc-bank-info {
    font-size: 12px;
    color: #374151;
    margin-bottom: 6px;
    line-height: 1.4;
}

.sm-qc-bank-info p {
    margin-bottom: 3px;
}

.sm-qc-bank-txn-input {
    font-size: 12.5px;
    height: 36px;
    min-height: 36px;
    padding-left: 10px;
}

/* Coupon Section */
.sm-qc-coupon-wrap {
    margin-bottom: 13px;
}

.sm-qc-coupon-input-group {
    display: flex;
    gap: 6px;
}

.sm-qc-coupon-input {
    padding-left: 12px;
    flex: 1;
}

.sm-qc-btn-apply {
    background: var(--sm-buy-btn-bg, var(--sm-primary, #FF6A00));
    border: none;
    border-radius: var(--sm-qc-btn-radius, 2px);
    color: var(--sm-btn-text, #ffffff);
    font-size: 13.5px;
    font-weight: 700;
    padding: 0 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sm-qc-btn-apply:hover {
    background: var(--sm-btn-hover-bg, var(--sm-primary-hover, #e55f00));
    color: var(--sm-btn-text, #ffffff);
    filter: brightness(0.95);
}

.sm-qc-coupon-status {
    font-size: 12px;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 2px;
}

.sm-qc-coupon-status.success {
    background: #ecfdf5;
    color: #059669;
}

.sm-qc-coupon-status.error {
    background: #fef2f2;
    color: #dc2626;
}

/* Cart Items Section */
.sm-qc-items-section {
    background: #fbfbfb;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 9px 11px;
    margin-bottom: 13px;
}

.sm-qc-items-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.sm-qc-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 9px;
    border-bottom: 1px dashed #e2e8f0;
}

.sm-qc-item-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.sm-qc-item-thumb {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 2px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.sm-qc-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sm-qc-item-qty-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--sm-primary, #FF6A00);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 0 0 0 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-qc-item-info {
    flex: 1;
    min-width: 0;
}

.sm-qc-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #111111;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sm-qc-item-meta {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 3px;
}

/* Stepper */
.sm-qc-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    background: #ffffff;
    overflow: hidden;
}

.sm-qc-step-btn {
    background: transparent;
    border: none;
    width: 23px;
    height: 23px;
    font-size: 13px;
    font-weight: bold;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.12s ease;
}

.sm-qc-step-btn:hover {
    background: #f1f5f9;
    color: #000000;
}

.sm-qc-step-val {
    width: 26px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #111111;
}

.sm-qc-item-price {
    font-size: 13.5px;
    font-weight: 700;
    color: #111111;
    text-align: right;
    white-space: nowrap;
}

.sm-qc-item-remove {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.15s ease;
}

.sm-qc-item-remove i {
    font-family: feather !important;
    font-style: normal !important;
    font-weight: normal !important;
    font-size: 15px;
    line-height: 1;
    display: inline-block;
    speak: none;
}

.sm-qc-item-remove:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Summary Box */
.sm-qc-summary-card {
    background: #fafafa;
    border: 1px solid #f1f5f9;
    border-radius: 3px;
    padding: 11px 13px;
    margin-bottom: 14px;
}

.sm-qc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #475569;
    margin-bottom: 5px;
}

.sm-qc-summary-row:last-child {
    margin-bottom: 0;
}

.sm-qc-summary-val {
    font-weight: 600;
    color: #111111;
}

.sm-qc-row-discount .sm-qc-summary-val {
    color: #059669;
}

.sm-qc-row-total {
    border-top: 1px dashed #e2e8f0;
    padding-top: 7px;
    margin-top: 5px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.sm-qc-row-total .sm-qc-grand-total {
    font-size: 17px;
    color: var(--sm-primary, #FF6A00);
}

/* Action / Submit Button - Inherits Dynamic Primary Color */
.sm-qc-actions {
    text-align: center;
}

.sm-qc-submit-btn {
    width: 100%;
    background: var(--sm-buy-btn-bg, var(--sm-primary, #FF6A00));
    color: var(--sm-btn-text, #ffffff);
    border: none;
    border-radius: var(--sm-qc-btn-radius, 2px);
    padding: 13px 20px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.sm-qc-submit-btn:hover {
    background: var(--sm-btn-hover-bg, var(--sm-primary-hover, #e55f00));
    color: var(--sm-btn-text, #ffffff);
    filter: brightness(0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.sm-qc-submit-btn:active {
    transform: translateY(1px);
    filter: brightness(0.85);
}

.sm-qc-submit-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
}

.sm-qc-subtext {
    font-size: 11.5px;
    color: #64748b;
    margin: 7px 0 0 0;
    line-height: 1.4;
}

/* Spinner */
.sm-qc-btn-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: smQcSpin 0.75s linear infinite;
    display: inline-block;
}

.sm-qc-spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid #e2e8f0;
    border-top-color: var(--sm-primary, #FF6A00);
    border-radius: 50%;
    animation: smQcSpin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes smQcSpin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsiveness: Bottom Sheet (< 768px) with sharp top corners */
@media (max-width: 767px) {
    .sm-quick-checkout-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .sm-quick-checkout-modal {
        max-width: 100%;
        width: 100%;
        border-radius: 6px 6px 0 0;
        max-height: 92vh;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sm-quick-checkout-overlay.active .sm-quick-checkout-modal {
        transform: translateY(0);
    }

    .sm-qc-body {
        max-height: calc(92vh - 60px);
        padding: 13px 15px 18px;
    }

    .sm-qc-title {
        font-size: 14.5px;
        padding: 0 26px;
    }

    .sm-qc-submit-btn {
        font-size: 15px;
        padding: 12px 16px;
    }
}
