/* ==============================================
   WA Checkout — checkout.css
   ============================================== */

#wac-checkout *,
#wac-checkout *::before,
#wac-checkout *::after { box-sizing: border-box; }

#wac-checkout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #111827;
}

/* ---- Admin panel ------------------------------------------ */
.wac-admin-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.wac-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 20px;
    padding: 3px 10px;
    margin-bottom: 10px;
}

/* ---- Search ------------------------------------------ */
.wac-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.wac-search-wrap {
    position: relative;
    flex: 1;
}
.wac-search-ico {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}
.wac-search-wrap input,
#wac-prod-search {
    width: 100%;
    padding: 9px 36px 9px 32px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 7px !important;
    font-size: 14px !important;
    background: #fff !important;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.wac-search-wrap input:focus,
#wac-prod-search:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12) !important;
}

/* ---- Spinner ------------------------------------------ */
.wac-spinner {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: wac-spin .65s linear infinite;
}
@keyframes wac-spin { to { transform: translateY(-50%) rotate(360deg); } }

/* ---- Dropdown ------------------------------------------ */
.wac-dropdown {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-top: 4px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    z-index: 100;
    position: relative;
}
.wac-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}
.wac-dropdown-item:last-child { border-bottom: none; }
.wac-dropdown-item:hover, .wac-dropdown-item:focus { background: #eff6ff; outline: none; }
.wac-dropdown-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #dbeafe; color: #1e40af;
    font-size: 12px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.wac-dropdown-name { font-size: 13px; font-weight: 500; color: #111827; }
.wac-dropdown-meta { font-size: 11px; color: #6b7280; }

/* Product dropdown thumbnail */
.wac-prod-thumb {
    width: 36px; height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.wac-dropdown-price { font-size: 12px; color: #059669; font-weight: 500; white-space: nowrap; }

/* ---- Notices ------------------------------------------ */
.wac-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
}
.wac-notice--success { background: #f0fdf4; border: 1px solid #bbf7d0; }
.wac-notice--warn    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.wac-notice-body { flex: 1; }
.wac-notice-body strong { display: block; font-size: 13px; font-weight: 600; color: #065f46; }
.wac-notice-body span   { font-size: 11px; color: #6b7280; }
.wac-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #bbf7d0; color: #065f46;
    font-size: 12px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ---- Layout columns ------------------------------------------ */
.wac-columns {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 860px) {
    .wac-columns { grid-template-columns: 1fr; }
}

/* ---- Card ------------------------------------------ */
.wac-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.wac-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0 0 14px;
}
.wac-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* ---- Form fields ------------------------------------------ */
.wac-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}
.wac-field:last-child { margin-bottom: 0; }
.wac-field label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}
.wac-field input,
.wac-field select,
.wac-field textarea {
    padding: 9px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 7px !important;
    font-size: 14px !important;
    background: #fff !important;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    width: 100%;
}
.wac-field input:focus,
.wac-field select:focus,
.wac-field textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12) !important;
}
.wac-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wac-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 500px) {
    .wac-row-2, .wac-row-3 { grid-template-columns: 1fr; }
}
.wac-req      { color: #ef4444; }
.wac-optional { font-size: 11px; color: #9ca3af; font-weight: 400; }
.wac-inline-field {
    display: flex;
    gap: 6px;
    align-items: center;
}
.wac-inline-field input,
.wac-inline-field select {
    padding: 8px 10px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    background: #fff !important;
    box-shadow: none !important;
    outline: none;
}

/* ---- Checkbox ------------------------------------------ */
.wac-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}
.wac-checkbox-label input[type=checkbox] {
    width: 16px; height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* ---- Product list ------------------------------------------ */
.wac-product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.wac-product-item:last-child { border-bottom: none; }
.wac-prod-img {
    width: 40px; height: 40px;
    border-radius: 7px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.wac-prod-info { flex: 1; min-width: 0; }
.wac-prod-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wac-prod-sku  { font-size: 11px; color: #9ca3af; }
.wac-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
}
.wac-qty-btn {
    width: 26px; height: 26px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: #374151;
    line-height: 1;
    transition: background .12s;
    padding: 0;
}
.wac-qty-btn:hover { background: #e5e7eb; }
.wac-qty-val {
    width: 30px; text-align: center;
    font-size: 13px; font-weight: 600;
}
.wac-prod-price { font-size: 13px; font-weight: 600; white-space: nowrap; min-width: 70px; text-align: right; }
.wac-remove-btn {
    width: 28px; height: 28px;
    border: none; background: none;
    cursor: pointer; color: #9ca3af;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    transition: color .12s, background .12s;
    padding: 0;
}
.wac-remove-btn:hover { color: #ef4444; background: #fef2f2; }

/* ---- Summary ------------------------------------------ */
.wac-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 0;
    color: #374151;
}
.wac-summary-total {
    font-size: 16px;
    font-weight: 700;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid #e5e7eb;
}

/* ---- Shipping rates ------------------------------------------ */
.wac-shipping-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: border-color .15s, background .15s;
}
.wac-shipping-option:last-child { margin-bottom: 0; }
.wac-shipping-option:hover { border-color: #93c5fd; background: #eff6ff; }
.wac-shipping-option.selected { border-color: #3b82f6; background: #eff6ff; }
.wac-shipping-option input[type=radio] { accent-color: #3b82f6; }
.wac-shipping-label { flex: 1; }
.wac-shipping-cost  { font-weight: 600; color: #059669; }

/* ---- Payment methods ------------------------------------------ */
.wac-payment-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: border-color .15s, background .15s;
}
.wac-payment-option:last-child { margin-bottom: 0; }
.wac-payment-option:hover { border-color: #93c5fd; background: #eff6ff; }
.wac-payment-option.selected { border-color: #3b82f6; background: #eff6ff; }
.wac-payment-option input[type=radio] { margin-top: 2px; accent-color: #3b82f6; flex-shrink: 0; }
.wac-payment-title { font-weight: 600; color: #111827; }
.wac-payment-desc-text { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* ---- Buttons ------------------------------------------ */
.wac-btn-sm {
    padding: 7px 13px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    background: #fff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    color: #374151 !important;
    white-space: nowrap;
    transition: background .12s;
    line-height: 1.4 !important;
}
.wac-btn-sm:hover { background: #f3f4f6 !important; }
.wac-place-btn {
    width: 100%;
    padding: 14px !important;
    background: #1d4ed8 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 9px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    transition: background .15s, transform .1s;
    line-height: 1 !important;
}
.wac-place-btn:hover   { background: #1e40af !important; }
.wac-place-btn:active  { transform: scale(.99); }
.wac-place-btn:disabled { background: #93c5fd !important; cursor: not-allowed !important; }
.wac-btn-primary {
    display: inline-flex; align-items: center;
    padding: 10px 20px;
    background: #1d4ed8; color: #fff !important;
    border-radius: 8px; font-weight: 600; font-size: 14px;
    text-decoration: none;
    transition: background .15s;
}
.wac-btn-primary:hover { background: #1e40af; }
.wac-btn-secondary {
    display: inline-flex; align-items: center;
    padding: 10px 20px;
    background: #f3f4f6; color: #374151 !important;
    border-radius: 8px; font-weight: 500; font-size: 14px;
    text-decoration: none;
    transition: background .15s;
}
.wac-btn-secondary:hover { background: #e5e7eb; }

/* ---- Badge ------------------------------------------ */
.wac-badge {
    font-size: 11px; font-weight: 500;
    border-radius: 20px; padding: 3px 10px; white-space: nowrap;
}
.wac-badge--blue { background: #dbeafe; color: #1e40af; }

/* ---- Utils ------------------------------------------ */
.wac-muted  { color: #9ca3af; font-size: 13px; }
.wac-error  { color: #ef4444; font-size: 13px; }
.wac-hidden { display: none !important; }

/* ---- Success box ------------------------------------------ */
.wac-success-box {
    text-align: center;
    padding: 32px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    margin-top: 12px;
}
.wac-success-box svg { color: #16a34a; margin-bottom: 12px; }
.wac-success-box h3  { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.wac-success-box p   { font-size: 14px; color: #374151; margin-bottom: 18px; }
.wac-success-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
