/* =============================================================
   WC COD Order Form — Dark card design
   ============================================================= */

/* ── Wrapper ── */
.wc-cod-wrapper {
    background: #1e1e2e;
    border-radius: 12px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    margin: 40px 0;
    max-width: 100%;
}

/* ── Order Summary ── */
.wc-cod-summary {
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.wc-cod-product-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.wc-cod-thumb-wrap {
    position: relative;
    flex-shrink: 0;
}

.wc-cod-thumb-wrap img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    display: block;
}

.wc-cod-qty-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #555;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1e1e2e;
    line-height: 1;
}

.wc-cod-product-name {
    flex: 1;
    font-size: 0.875rem;
    color: #d1d5db;
    line-height: 1.4;
}

.wc-cod-product-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

/* Totals rows */
.wc-cod-totals {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wc-cod-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #9ca3af;
    padding: 7px 0;
    border-top: 1px solid rgba(255,255,255,.05);
}

.wc-cod-row:first-child {
    border-top: none;
}

.wc-cod-free {
    color: #34d399 !important;
    font-weight: 600;
}

.wc-cod-total-row {
    border-top: 1px solid rgba(255,255,255,.14) !important;
    margin-top: 4px;
    padding-top: 10px !important;
}

.wc-cod-total-row span {
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
}

/* ── Form ── */
.wc-cod-form {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Input field rows */
.wc-cod-field {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    height: 48px;
    transition: box-shadow .15s;
}

.wc-cod-field:focus-within {
    box-shadow: 0 0 0 2.5px rgba(255,255,255,.3);
}

.wc-cod-field-icon {
    width: 46px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6b7280;
    border-right: 1px solid #e5e7eb;
    background: #f9fafb;
}

.wc-cod-field-icon svg {
    width: 18px;
    height: 18px;
}

.wc-cod-field input[type="text"],
.wc-cod-field input[type="tel"] {
    flex: 1;
    height: 100%;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 14px !important;
    font-size: 0.92rem !important;
    color: #111827 !important;
    background: transparent !important;
    font-family: inherit;
    border-radius: 0 !important;
}

.wc-cod-field input::placeholder {
    color: #9ca3af !important;
}

/* Subscribe */
.wc-cod-subscribe {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 4px 0;
}

.wc-cod-subscribe input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.wc-cod-check-box {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid rgba(255,255,255,.3);
    border-radius: 4px;
    background: rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}

.wc-cod-subscribe input:checked + .wc-cod-check-box {
    background: #3b82f6;
    border-color: #3b82f6;
}

.wc-cod-subscribe input:checked + .wc-cod-check-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

.wc-cod-subscribe-text {
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.45;
}

/* Error */
.wc-cod-error {
    background: rgba(239,68,68,.15);
    border: 1px solid rgba(239,68,68,.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Submit button */
.wc-cod-btn {
    width: 100% !important;
    height: 52px !important;
    background: #111827 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 9px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    letter-spacing: .02em;
    transition: background .15s, transform .1s;
    margin-top: 4px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: none !important;
    box-shadow: none !important;
    padding: 0 20px !important;
}

.wc-cod-btn:hover:not(:disabled) {
    background: #000 !important;
    color: #fff !important;
}

.wc-cod-btn:active:not(:disabled) {
    transform: scale(.98);
}

.wc-cod-btn:disabled {
    opacity: .7 !important;
    cursor: not-allowed;
}

.wc-cod-btn-idle,
.wc-cod-btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

/* Spinner */
@keyframes wc-cod-spin {
    to { transform: rotate(360deg); }
}

.wc-cod-spinner {
    animation: wc-cod-spin .7s linear infinite;
}

/* ── Success state ── */
.wc-cod-success {
    padding: 48px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}

.wc-cod-success svg {
    color: #34d399;
}

.wc-cod-success h3 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.wc-cod-success p {
    font-size: 0.88rem;
    color: #9ca3af;
    margin: 0;
    line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .wc-cod-wrapper {
        border-radius: 10px;
        margin: 28px 0;
    }

    .wc-cod-summary,
    .wc-cod-form {
        padding-left: 16px;
        padding-right: 16px;
    }
}
