/* =====================================================
   WCCA Buy 1 Get 1 Popup
   ===================================================== */
.wcca-bogo-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wcca-bogo-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(4px);
    animation: wcca-bogo-fade 0.25s ease;
}

.wcca-bogo-popup__card {
    position: relative;
    max-width: 460px;
    width: calc(100% - 32px);
    background: #fff;
    border-radius: 14px;
    padding: 36px 32px 28px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    animation: wcca-bogo-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wcca-bogo-popup__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}
.wcca-bogo-popup__close:hover {
    background: #f0f0f0;
    color: #333;
}

.wcca-bogo-popup__badge {
    display: inline-block;
    background: #1c1c1c;
    color: #c13124;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.wcca-bogo-popup__title {
    font-size: 30px;
    line-height: 1.15;
    color: #1c1c1c;
    margin: 0 0 14px;
    font-weight: 700;
}
.wcca-bogo-popup__title strong {
    color: #c13124;
}

.wcca-bogo-popup__sub {
    font-size: 15px;
    line-height: 1.55;
    color: #555;
    margin: 0 0 24px;
}

.wcca-bogo-popup__field {
    margin-bottom: 12px;
}

.wcca-bogo-popup__field input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    font-family: inherit;
}
.wcca-bogo-popup__field input:focus {
    outline: none;
    border-color: #c13124;
    box-shadow: 0 0 0 3px rgba(193, 49, 36, 0.12);
}

.wcca-bogo-popup__submit {
    width: 100%;
    padding: 14px 20px;
    background: #c13124;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    position: relative;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
    font-family: inherit;
    text-align: center;
}
.wcca-bogo-popup__submit:hover:not(:disabled) {
    background: #a3291e;
    color: #fff;
}
.wcca-bogo-popup__submit:disabled {
    opacity: 0.7;
    cursor: default;
}
.wcca-bogo-popup__submit--alt {
    background: #fff;
    color: #1c1c1c;
    border: 1.5px solid #ddd;
    margin-top: 8px;
}
.wcca-bogo-popup__submit--alt:hover {
    background: #f5f5f5;
    color: #1c1c1c;
}

.wcca-bogo-popup__btn-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.wcca-bogo-popup__loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: wcca-bogo-spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}
.wcca-bogo-popup__submit.is-loading .wcca-bogo-popup__loader { display: inline-block; }
.wcca-bogo-popup__submit.is-loading .wcca-bogo-popup__btn-text { opacity: 0.7; }

.wcca-bogo-popup__error {
    color: #c13124;
    font-size: 13px;
    margin: 10px 0 0;
}

.wcca-bogo-popup__fineprint {
    font-size: 11px;
    color: #888;
    margin: 18px 0 0;
    line-height: 1.5;
}

.wcca-bogo-popup__icon-success,
.wcca-bogo-popup__icon-info {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
}
.wcca-bogo-popup__icon-success {
    background: #d1f5d9;
    color: #1b7a2a;
}
.wcca-bogo-popup__icon-info {
    background: #fff3cd;
    color: #8a6d00;
}

@keyframes wcca-bogo-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes wcca-bogo-pop {
    from { opacity: 0; transform: translateY(20px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes wcca-bogo-spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   Cart cap notice
   ===================================================== */
.woocommerce-info.wcca-bogo-cap-notice {
    border-top-color: #c13124;
}
.woocommerce-info.wcca-bogo-cap-notice::before {
    color: #c13124;
}

/* =====================================================
   Locked email field (when in Buy 1 Get 1 signup mode)
   ===================================================== */
.wcca-locked-field {
    background: #f5f5f5 !important;
    cursor: not-allowed !important;
    color: #555 !important;
}

/* =====================================================
   Checkout Validate Panel
   ===================================================== */
.wcca-bogo-validate {
    background: #fff;
    border: 2px solid #c13124;
    border-radius: 10px;
    padding: 20px 24px;
    margin: 0 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wcca-bogo-validate__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
}

.wcca-bogo-validate__icon {
    font-size: 22px;
}

.wcca-bogo-validate__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #c13124;
}

.wcca-bogo-validate__msg {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 14px;
}

.wcca-bogo-validate__btn {
    display: inline-block;
    padding: 12px 24px;
    background: #c13124;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    position: relative;
    text-transform: uppercase;
}

.wcca-bogo-validate__btn:hover:not(:disabled) {
    background: #a3291e;
}

.wcca-bogo-validate__btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.wcca-bogo-validate__btn.is-loading {
    color: rgba(255, 255, 255, 0.6);
}

.wcca-bogo-validate__loader {
    display: none;
    position: absolute;
    top: 50%;
    right: 12px;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wcca-bogo-spin 0.8s linear infinite;
}

.wcca-bogo-validate__btn.is-loading .wcca-bogo-validate__loader {
    display: inline-block;
}

.wcca-bogo-validate__success {
    background: #d1f5d9;
    color: #1b5a20;
    padding: 14px 16px;
    border-radius: 6px;
    border-left: 4px solid #1b7a2a;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wcca-bogo-validate__check {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: #1b7a2a;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: 700;
    flex-shrink: 0;
}

.wcca-bogo-validate__error {
    background: #fff3f2;
    color: #8b1a13;
    padding: 14px 16px;
    border-radius: 6px;
    border-left: 4px solid #c13124;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.5;
}

.wcca-bogo-validate__error strong {
    display: block;
    margin-bottom: 6px;
    color: #c13124;
}

.wcca-bogo-validate__error-msg {
    margin: 0;
    color: #555;
}

.wcca-bogo-validate__notice {
    background: #fff8e6;
    color: #6b4f00;
    padding: 14px 16px;
    border-radius: 6px;
    border-left: 4px solid #d4a017;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
}

.wcca-bogo-validate__notice strong {
    display: block;
    margin-bottom: 6px;
    color: #8a6d00;
}

.wcca-bogo-validate__notice p {
    margin: 0;
}

/* =====================================================
   Place Order hidden when not validated
   ===================================================== */
#place_order.wcca-bogo-hidden {
    display: none !important;
}

/* Also hide WC's submit wrapper if it would leave an empty box */
.wcca-bogo-hidden + .button {
    display: none !important;
}

/* =====================================================
   Login link in popup (new)
   ===================================================== */
.wcca-bogo-popup__login-link {
    margin: 14px 0 0;
    font-size: 13px;
    color: #666;
}
.wcca-bogo-popup__login-link a {
    color: #c13124;
    font-weight: 600;
    text-decoration: none;
}
.wcca-bogo-popup__login-link a:hover {
    text-decoration: underline;
}

/* =====================================================
   Blocks Cart bonus item badge + FREE label
   ===================================================== */
.wcca-bogo-badge {
    display: inline-block;
    background: #c13124;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
}

.wcca-bogo-free-label {
    color: #c13124;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 14px;
}

.wcca-bogo-bonus-row {
    background: linear-gradient(90deg, rgba(193,49,36,0.04) 0%, rgba(193,49,36,0) 100%);
    border-left: 3px solid #c13124;
}

/* Blocks-injected validate panel sits above checkout actions */
.wp-block-woocommerce-checkout-actions-block #wcca-bogo-validate-panel,
.wc-block-checkout__actions #wcca-bogo-validate-panel {
    margin-bottom: 16px;
}

/* =====================================================
   Substitute Notice (Blocks cart + checkout)
   ===================================================== */
.wcca-bogo-substitute-notice {
    background: #fff8e6;
    border: 1px solid #d4a017;
    border-left: 4px solid #d4a017;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 0 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #6b4f00;
}
.wcca-bogo-substitute-notice__inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.wcca-bogo-substitute-notice__icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1.2;
}
.wcca-bogo-substitute-notice__msg {
    flex: 1;
}
