/* Popup Checkout - popup-checkout.css */

/* Overlay */
.pco-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: pco-fade-in 0.2s ease;
}

@keyframes pco-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal */
.pco-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    animation: pco-slide-up 0.25s ease;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.pco-modal::-webkit-scrollbar { width: 4px; }
.pco-modal::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

@keyframes pco-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Header */
.pco-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-radius: 16px 16px 0 0;
}

.pco-modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.pco-close {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    flex-shrink: 0;
    transition: background 0.15s;
}

.pco-close:hover { background: #ebebeb; color: #111; }

/* Body */
.pco-modal-body { padding: 16px 20px 20px; }

/* Input fields */
.pco-field {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 0 14px;
    margin-bottom: 10px;
    background: #fff;
    transition: border-color 0.15s;
}

.pco-field:focus-within { border-color: #6b4de6; }

.pco-field-icon {
    color: #aaa;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.pco-field input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 14px;
    color: #1a1a1a;
    background: transparent;
    font-family: inherit;
    width: 100%;
}

.pco-field input::placeholder { color: #bbb; }

.pco-field-note {
    align-items: flex-start;
    padding: 10px 14px;
}

.pco-field-note textarea {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1a1a1a;
    background: transparent;
    font-family: inherit;
    resize: vertical;
    min-height: 56px;
    line-height: 1.5;
    width: 100%;
}

.pco-field-note textarea::placeholder { color: #bbb; }

/* Product row */
.pco-product-row {
    display: flex;
    gap: 14px;
    align-items: center;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
}

.pco-product-img-wrap {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}

.pco-product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.pco-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.3;
}

.pco-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #27ae60;
    margin: 0 0 8px;
}

.pco-qty-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
}

.pco-qty-btn {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
    line-height: 1;
}

.pco-qty-btn:hover { border-color: #6b4de6; color: #6b4de6; background: #f4f0fd; }

#pco-qty {
    width: 40px;
    text-align: center;
    border: none;
    outline: none;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    background: transparent;
    -moz-appearance: textfield;
    font-family: inherit;
}

#pco-qty::-webkit-outer-spin-button,
#pco-qty::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Coupon */
.pco-coupon-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 0 14px;
    margin-bottom: 6px;
    background: #fff;
    transition: border-color 0.15s;
}

.pco-coupon-row:focus-within { border-color: #6b4de6; }

.pco-coupon-icon { color: #aaa; display: flex; align-items: center; flex-shrink: 0; }

.pco-coupon-row input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 14px;
    color: #1a1a1a;
    background: transparent;
    font-family: inherit;
}

.pco-coupon-row input::placeholder { color: #bbb; }

.pco-apply-btn {
    background: #6b4de6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.15s;
}

.pco-apply-btn:hover { background: #5939c7; }

.pco-coupon-msg {
    font-size: 12px;
    margin: 0 0 10px;
    padding: 6px 10px;
    border-radius: 6px;
}

.pco-coupon-msg.success { background: #edfbf3; color: #1a7a40; }
.pco-coupon-msg.error   { background: #fef0f0; color: #c0392b; }

/* Section label */
.pco-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    margin: 14px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Radio delivery options */
.pco-radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.pco-radio-option:hover { border-color: #c4b5f9; }

.pco-radio-option input[type="radio"] { display: none; }

.pco-radio-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s;
    background: #fff;
}

.pco-radio-circle::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.15s;
}

.pco-radio-option input[type="radio"]:checked ~ .pco-radio-circle {
    border-color: #6b4de6;
}

.pco-radio-option input[type="radio"]:checked ~ .pco-radio-circle::after {
    background: #6b4de6;
}

.pco-radio-option input[type="radio"]:checked ~ .pco-radio-label { color: #6b4de6; font-weight: 600; }

.pco-radio-option:has(input[type="radio"]:checked) {
    border-color: #6b4de6;
    background: #f8f5ff;
}

.pco-radio-label { font-size: 14px; color: #333; }
.pco-radio-label strong { color: inherit; }

/* Summary */
.pco-summary {
    background: #fafafa;
    border: 1.5px solid #f0f0f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 4px 0 4px;
}

.pco-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #444;
    margin-bottom: 8px;
}

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

.pco-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    border-top: 1.5px solid #e8e8e8;
    padding-top: 10px;
    margin-top: 8px;
}

/* Select */
.pco-select-wrap {
    position: relative;
    margin-bottom: 4px;
}

.pco-select-wrap select {
    width: 100%;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px 40px 12px 14px;
    font-size: 14px;
    color: #1a1a1a;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.pco-select-wrap select:focus { border-color: #6b4de6; }

.pco-select-wrap::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #888;
    pointer-events: none;
}

/* Error */
.pco-error-msg {
    font-size: 13px;
    color: #c0392b;
    background: #fef0f0;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    margin-bottom: 0;
}

/* Submit */
.pco-submit-btn {
    width: 100%;
    background: #6b4de6;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
    font-family: inherit;
    letter-spacing: 0.2px;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pco-submit-btn:hover:not(:disabled) { background: #5939c7; }
.pco-submit-btn:active:not(:disabled) { transform: scale(0.99); }
.pco-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* Spinner */
.pco-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pco-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* Success modal */
.pco-success-modal {
    text-align: center;
    padding: 40px 24px;
}

.pco-success-icon {
    width: 80px;
    height: 80px;
    background: #edfbf3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #27ae60;
}

.pco-success-text {
    font-size: 15px;
    color: #1a1a1a;
    line-height: 1.6;
    margin: 0;
}

/* Mobile */
@media (max-width: 480px) {
    .pco-overlay { padding: 0; align-items: flex-end; }
    .pco-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
    }
    .pco-modal-header { border-radius: 20px 20px 0 0; }
}
