/* WooCommerce Quick Checkout - Frontend Styles */

:root {
    --wqc-primary: #1a1a2e;
    --wqc-border: #e2e8f0;
    --wqc-border-radius: 12px;
    --wqc-input-bg: #f8fafc;
    --wqc-text: #1e293b;
    --wqc-label: #374151;
    --wqc-muted: #64748b;
    --wqc-error: #ef4444;
    --wqc-shadow: 0 4px 24px rgba(0,0,0,0.08);
    --wqc-upsell-bg: #fffbeb;
    --wqc-upsell-border: #fde68a;
    --wqc-checked-bg: #fef3c7;
    --wqc-checked-border: #f59e0b;
    --wqc-free-color: #059669;
}

/* ============================================================
   WRAPPER — scoped so all styles only affect the plugin form
   ============================================================ */

.wqc-quick-checkout-wrap {
    border: 2px solid var(--wqc-border);
    border-radius: var(--wqc-border-radius);
    margin: 24px 0;
    overflow: hidden;
    box-shadow: var(--wqc-shadow);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--wqc-text);
    background: #fff;
    box-sizing: border-box;
}

/* ============================================================
   RTL
   ============================================================ */

.wqc-quick-checkout-wrap[dir="rtl"] {
    text-align: right;
}

.wqc-quick-checkout-wrap[dir="rtl"] .wqc-input-icon {
    left: auto !important;
    right: 14px !important;
}

.wqc-quick-checkout-wrap[dir="rtl"] .wqc-input {
    padding-left: 14px !important;
    padding-right: 46px !important;
    text-align: right !important;
}

/* ============================================================
   HEADER
   ============================================================ */

.wqc-quick-checkout-wrap .wqc-form-header {
    background: #1a1a2e;
    color: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wqc-quick-checkout-wrap .wqc-form-header h3.wqc-form-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff !important;
    line-height: 1.3;
}

.wqc-quick-checkout-wrap .wqc-header-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ============================================================
   BODY
   ============================================================ */

.wqc-quick-checkout-wrap .wqc-form-body {
    padding: 24px;
}

.wqc-quick-checkout-wrap .wqc-form-subtitle {
    color: var(--wqc-muted);
    font-size: 14px;
    margin: 0 0 20px;
    padding: 0;
}

/* ============================================================
   TWO-COLUMN LAYOUT
   ============================================================ */

.wqc-quick-checkout-wrap .wqc-form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 640px) {
    .wqc-quick-checkout-wrap .wqc-form-columns {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   FORM FIELDS
   ============================================================ */

.wqc-quick-checkout-wrap .wqc-field-group {
    margin-bottom: 16px;
}

.wqc-quick-checkout-wrap .wqc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--wqc-label);
    margin-bottom: 6px;
    padding: 0;
}

.wqc-quick-checkout-wrap .wqc-required {
    color: var(--wqc-error);
}

/* Input wrapper — holds icon + input as a flex row */
.wqc-quick-checkout-wrap .wqc-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--wqc-border);
    border-radius: 8px;
    background: var(--wqc-input-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.wqc-quick-checkout-wrap .wqc-input-wrap:focus-within {
    border-color: var(--wqc-primary);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
    background: #fff;
}

.wqc-quick-checkout-wrap .wqc-input-wrap.wqc-wrap-error {
    border-color: var(--wqc-error);
}

/* Icon — lives OUTSIDE the input as a flex sibling */
.wqc-quick-checkout-wrap .wqc-input-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-left: 12px;
    opacity: 0.4;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    pointer-events: none;
}

/* The actual input — no left padding needed, icon is outside */
.wqc-quick-checkout-wrap .wqc-input {
    flex: 1;
    width: 100% !important;
    min-width: 0;
    padding: 11px 14px !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-size: 14px !important;
    color: var(--wqc-text) !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    box-sizing: border-box;
    margin: 0 !important;
}

.wqc-quick-checkout-wrap .wqc-input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* SVG icons */
.wqc-quick-checkout-wrap .wqc-icon-person {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23374151'%3E%3Cpath d='M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z'/%3E%3C/svg%3E");
}

.wqc-quick-checkout-wrap .wqc-icon-phone {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23374151'%3E%3Cpath d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.6 21 3 13.4 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1L6.6 10.8z'/%3E%3C/svg%3E");
}

.wqc-quick-checkout-wrap .wqc-icon-location {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23374151'%3E%3Cpath d='M12 2C8.1 2 5 5.1 5 9c0 5.3 7 13 7 13s7-7.7 7-13c0-3.9-3.1-7-7-7zm0 9.5c-1.4 0-2.5-1.1-2.5-2.5S10.6 6.5 12 6.5s2.5 1.1 2.5 2.5S13.4 11.5 12 11.5z'/%3E%3C/svg%3E");
}

/* Field error text */
.wqc-quick-checkout-wrap .wqc-field-error {
    display: block;
    color: var(--wqc-error);
    font-size: 12px;
    margin-top: 4px;
}

/* ============================================================
   RIGHT COLUMN
   ============================================================ */

.wqc-quick-checkout-wrap .wqc-right-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================================
   SHIPPING
   ============================================================ */

.wqc-quick-checkout-wrap .wqc-shipping-section {
    border: 1.5px solid var(--wqc-border);
    border-radius: 10px;
    padding: 14px;
    background: #f8fafc;
}

.wqc-quick-checkout-wrap .wqc-section-label {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--wqc-label);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wqc-quick-checkout-wrap .wqc-shipping-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--wqc-border);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}

.wqc-quick-checkout-wrap .wqc-shipping-option input[type="radio"] {
    display: none !important;
}

.wqc-quick-checkout-wrap .wqc-radio-dot {
    width: 18px;
    height: 18px;
    border: 2px solid var(--wqc-primary);
    border-radius: 50%;
    flex-shrink: 0;
    background: #fff;
    position: relative;
}

.wqc-quick-checkout-wrap .wqc-shipping-selected .wqc-radio-dot::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--wqc-primary);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wqc-quick-checkout-wrap .wqc-shipping-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.wqc-quick-checkout-wrap .wqc-free-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--wqc-free-color);
    background: #d1fae5;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ============================================================
   UPSELLS
   ============================================================ */

.wqc-quick-checkout-wrap .wqc-upsells-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wqc-quick-checkout-wrap .wqc-upsell-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1.5px solid var(--wqc-upsell-border);
    border-radius: 10px;
    background: var(--wqc-upsell-bg);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.wqc-quick-checkout-wrap .wqc-upsell-item:hover {
    background: #fef3c7;
    transform: translateY(-1px);
}

.wqc-quick-checkout-wrap .wqc-upsell-item.wqc-upsell-checked {
    background: var(--wqc-checked-bg);
    border-color: var(--wqc-checked-border);
}

.wqc-quick-checkout-wrap .wqc-upsell-checkbox-wrap {
    flex-shrink: 0;
}

.wqc-quick-checkout-wrap .wqc-upsell-check {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.wqc-quick-checkout-wrap .wqc-custom-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.wqc-quick-checkout-wrap .wqc-upsell-item.wqc-upsell-checked .wqc-custom-checkbox {
    background: var(--wqc-checked-border);
    border-color: var(--wqc-checked-border);
}

.wqc-quick-checkout-wrap .wqc-upsell-item.wqc-upsell-checked .wqc-custom-checkbox::after {
    content: '';
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg) translateY(-2px);
    display: block;
}

.wqc-quick-checkout-wrap .wqc-upsell-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.wqc-quick-checkout-wrap .wqc-upsell-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}

.wqc-quick-checkout-wrap .wqc-upsell-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wqc-quick-checkout-wrap .wqc-upsell-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--wqc-text);
    line-height: 1.3;
    word-break: break-word;
}

.wqc-quick-checkout-wrap .wqc-upsell-price {
    font-size: 12px;
    color: #92400e;
    font-weight: 500;
}

/* ============================================================
   MESSAGES
   ============================================================ */

.wqc-quick-checkout-wrap .wqc-message {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin: 16px 0 8px;
}

.wqc-quick-checkout-wrap .wqc-success-message {
    background: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #a7f3d0;
}

.wqc-quick-checkout-wrap .wqc-error-message {
    background: #fef2f2;
    color: #991b1b;
    border: 1.5px solid #fecaca;
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */

.wqc-quick-checkout-wrap .wqc-submit-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    width: 100% !important;
    padding: 16px 24px !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    margin-top: 20px !important;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.3px;
    text-transform: none !important;
    line-height: 1.4 !important;
    box-sizing: border-box;
}

.wqc-quick-checkout-wrap .wqc-submit-button:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.wqc-quick-checkout-wrap .wqc-submit-button:active {
    transform: translateY(0);
}

.wqc-quick-checkout-wrap .wqc-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.wqc-quick-checkout-wrap .wqc-btn-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.wqc-quick-checkout-wrap .wqc-total-display {
    font-weight: 800;
}

/* Loading spinner */
.wqc-quick-checkout-wrap .wqc-loading .wqc-btn-text::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wqc-spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* No-image placeholder */
.wqc-quick-checkout-wrap .wqc-no-image.dashicons {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 6px;
    color: #9ca3af;
    flex-shrink: 0;
}
