@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&display=swap');

/* ================================
   COD PRO AFRICA - FRONTEND FORM
================================ */
.codpro-wrap {
    font-family: 'Outfit', sans-serif;
    max-width: 540px;
    margin: 24px auto;
    padding: 0 16px;
    /* CSS variables injected inline from PHP (colors) */
}

.codpro-wrap .codpro-card,
.codpro-wrap .cpro-input,
.codpro-wrap .cpro-submit-btn,
.codpro-wrap .cpro-tier-card {
    border-radius: var(--cpa-radius, 14px);
}

.codpro-wrap.codpro-template-minimal .codpro-card {
    box-shadow: none;
    border: 1px solid rgba(0,0,0,.08);
}

.codpro-wrap.codpro-template-dark .codpro-card,
.codpro-wrap.codpro-template-dark .codpro-header {
    background: #101827;
    color: #fff;
}

.codpro-wrap.codpro-template-medical .codpro-card {
    border: 1px solid #d7ece5;
}

.codpro-wrap.codpro-template-nutra .cpro-submit-btn {
    text-transform: uppercase;
}

.cpro-radio-group {
    display: grid;
    gap: 8px;
}

.cpro-radio-group label {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--cpa-border-input);
    border-radius: 10px;
    background: var(--cpa-bg-input);
}

/* === Banner === */
.codpro-product-banner {
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    max-height: 240px;
}
.codpro-product-banner img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

/* === Card === */
.codpro-card {
    background: var(--cpa-bg-card, #fff);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.13);
    overflow: hidden;
    border: 1px solid #eee;
}
.codpro-product-banner + .codpro-card {
    border-radius: 0 0 16px 16px;
}

/* === Header === */
.codpro-header {
    background: var(--cpa-bg-header, #0f3460);
    padding: 24px 28px 20px;
    text-align: center;
    position: relative;
}
.codpro-header-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: var(--cpa-text-header, #fff);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    opacity: 0.9;
}
.codpro-title {
    color: var(--cpa-text-header, #fff);
    font-size: 22px;
    font-weight: 900;
    margin: 0 0 8px;
    line-height: 1.2;
}
.codpro-shipping {
    color: var(--cpa-text-header, #fff);
    opacity: 0.85;
    font-size: 13px;
    font-weight: 600;
}

/* === Urgency Bar === */
.codpro-urgency-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    background: #fff3e0;
    border-top: 1px solid #ffe0b2;
    border-bottom: 1px solid #ffe0b2;
}
.cpro-urg-item {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #bf360c;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cpro-urg-item + .cpro-urg-item { border-right: 1px solid #ffe0b2; order: -1; }
.cpro-urg-label { font-weight: 600; }
.cpro-timer-big {
    display: inline-block;
    background: #e53935;
    color: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 900;
    min-width: 62px;
    text-align: center;
}
.cpro-urg-stock strong {
    color: #e53935;
    font-size: 16px;
}

/* === Form === */
.codpro-form {
    padding: 24px 26px 22px;
}
.codpro-field-group { margin-bottom: 16px; }
.codpro-field-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    color: var(--cpa-text-label, #1a1a2e);
    margin-bottom: 8px;
}
.cpro-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-width: 20px;
    height: 20px;
    font-size: 17px;
    line-height: 1;
}
.cpro-req { color: #e53935; font-size: 17px; line-height: 1; }

.cpro-input {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--cpa-border-input, #e8e8e8);
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: var(--cpa-text-input, #1a1a2e);
    background: var(--cpa-bg-input, #f9faff);
    transition: all 0.2s;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}
.cpro-input:focus {
    border-color: var(--cpa-focus-input, #0f3460);
    background: var(--cpa-bg-card, #fff);
    box-shadow: 0 0 0 4px rgba(15,52,96,0.09);
}
.cpro-input.cpro-invalid {
    border-color: #e53935;
    background: #fff5f5;
    box-shadow: 0 0 0 4px rgba(229,57,53,0.08);
}
.cpro-input.cpro-valid { border-color: #2e7d32; }

.cpro-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a1a2e' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* Quantity */
.codpro-quantity-group {
    display: grid;
    gap: 8px;
}
.cpro-quantity-label {
    align-items: center;
    line-height: 1.25;
    margin-bottom: 0 !important;
}
.cpro-qty-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid var(--cpa-border-input, #e8e8e8);
    border-radius: 12px;
    overflow: hidden;
    background: var(--cpa-bg-input, #f9faff);
    width: 100%;
    max-width: 190px;
    min-height: 52px;
}
.cpro-qty-btn {
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    font-size: 22px;
    font-weight: 700;
    color: var(--cpa-focus-input, #0f3460);
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.cpro-qty-btn:hover { background: rgba(15,52,96,0.08); }
.cpro-qty-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    background: transparent;
}
.cpro-qty-input {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-align: center;
    max-width: 60px;
    box-shadow: none !important;
    font-weight: 800;
    font-size: 16px;
    padding: 0 !important;
    min-height: 48px;
}
.cpro-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.cpro-err {
    display: block;
    min-height: 17px;
    color: #e53935;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

/* === Tiers Preview === */
.cpro-tiers-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin: 4px 0 16px;
}
.cpro-tier-card {
    background: var(--cpa-bg-input, #f9faff);
    border: 2px solid var(--cpa-border-input, #e8e8e8);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
    position: relative;
}
.cpro-tier-card:hover {
    border-color: var(--cpa-accent, #e53935);
    transform: translateY(-2px);
}
.cpro-tier-card.active {
    border-color: var(--cpa-accent, #e53935);
    background: rgba(229,57,53,0.05);
    box-shadow: 0 0 0 3px rgba(229,57,53,0.15);
}
.cpro-tier-card.active::before {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--cpa-accent, #e53935);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
}
.cpro-tier-qty {
    font-size: 11px;
    color: var(--cpa-text-main, #666);
    opacity: 0.7;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cpro-tier-price {
    font-size: 16px;
    font-weight: 900;
    color: var(--cpa-text-main, #1a1a2e);
    margin-top: 4px;
}
.cpro-tier-label {
    display: inline-block;
    margin-top: 6px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: var(--cpa-accent, #e53935);
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}
.cpro-tier-savings {
    margin-top: 5px;
    font-size: 10px;
    font-weight: 700;
    color: #2e7d32;
    line-height: 1.25;
}

/* === Summary === */
.cpro-summary {
    background: var(--cpa-bg-input, #f9faff);
    border: 2px solid var(--cpa-border-input, #e8e8e8);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.cpro-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 14px;
    color: var(--cpa-text-main, #555);
}
.cpro-summary-row strong { font-weight: 700; }
.cpro-summary-saved strong { color: #2e7d32; }
.cpro-summary-total {
    border-top: 2px dashed var(--cpa-border-input, #e0e0e0);
    margin-top: 5px;
    padding-top: 10px;
    font-size: 15px;
}
.cpro-summary-total strong {
    font-size: 20px;
    font-weight: 900;
    color: var(--cpa-accent, #e53935);
}

/* === Submit === */
.cpro-submit-btn {
    width: 100%;
    padding: 17px;
    background: var(--cpa-btn-bg, #e53935);
    color: var(--cpa-btn-text, #fff);
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.25s;
    margin-top: 4px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}
.cpro-submit-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}
.cpro-submit-btn:hover::after { left: 100%; }
.cpro-submit-btn:hover {
    transform: translateY(-2px);
    background: var(--cpa-btn-bg-hover, #b71c1c);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.cpro-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* === Trust === */
.cpro-trust {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 12px;
    font-weight: 600;
    color: #888;
}

/* === Thank You === */
.codpro-ty-card {
    text-align: center;
    padding-bottom: 10px;
    animation: cpro-slideIn 0.5s ease;
}
@keyframes cpro-slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.codpro-ty-header {
    background: linear-gradient(135deg, #1b5e20, #2e7d32, #388e3c);
    padding: 32px 28px 24px;
}
.codpro-ty-check {
    font-size: 56px;
    margin-bottom: 10px;
    animation: cpro-pop 0.5s 0.2s both;
}
@keyframes cpro-pop {
    0% { transform: scale(0); }
    80%{ transform: scale(1.2); }
    100%{ transform: scale(1); }
}
.codpro-ty-header h2 { color: #fff; font-size: 22px; font-weight: 900; margin: 0 0 8px; }
.codpro-ty-msg {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    margin: 0 0 12px;
    line-height: 1.5;
}
.codpro-order-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

/* === Upsell === */
.codpro-upsell-box {
    margin: 20px 20px 16px;
    border: 2px solid #f4a72c;
    border-radius: 14px;
    overflow: hidden;
    background: #fffbf0;
}
.codpro-upsell-ribbon {
    background: linear-gradient(135deg, #f4a72c, #e05b1c);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: 800;
}
.codpro-timer-wrap {
    background: #fff3e0;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #bf360c;
    border-bottom: 1px solid #ffe0b2;
}
.codpro-timer { font-size: 18px; color: #e53935; }
.codpro-upsell-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}
.codpro-upsell-img {
    width: 90px; height: 90px; object-fit: cover;
    border-radius: 10px; flex-shrink: 0;
}
.codpro-upsell-info h3 {
    font-size: 15px; font-weight: 800; margin: 0 0 6px; color: #1a1a2e;
}
.codpro-upsell-info p { font-size: 13px; color: #555; margin: 0 0 10px; line-height: 1.4; }
.codpro-upsell-prices { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cpro-price-orig { text-decoration: line-through; color: #999; font-size: 14px; font-weight: 600; }
.cpro-price-new { font-size: 20px; font-weight: 900; color: #e53935; }

.cpro-upsell-accept-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 0 16px 10px;
    padding: 15px;
    background: linear-gradient(135deg, #f4a72c, #e05b1c);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.25s;
}
.cpro-upsell-accept-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244,167,44,0.5);
}
.cpro-upsell-decline-btn {
    display: block; width: 100%; padding: 10px; background: none; border: none;
    color: #aaa; font-family: 'Outfit', sans-serif; font-size: 12px;
    cursor: pointer; text-decoration: underline; margin-bottom: 10px;
}

/* === Responsive === */
@media (max-width: 480px) {
    .codpro-form { padding: 22px 18px 18px; }
    .codpro-header { padding: 20px 18px 18px; }
    .cpro-tiers-preview { grid-template-columns: 1fr 1fr; }
    .codpro-upsell-inner { flex-direction: column; text-align: center; }
    .codpro-upsell-prices { justify-content: center; }
}
