/* =============================================================
   EDD Clean Checkout v1.5
   Runtime IDs confirmed via browser console.
   Left:  #edd_checkout_user_info + #edd_cc_address
   Right: #edd_cc_fields + #edd_purchase_submit
   Full-width above: #edd_discount_code
   Full-width below: .ecc-trust-badges
   ============================================================= */

/* ── Page width & wrap ────────────────────────────────────── */
#edd_checkout_wrap {
    font-size: 15px;
    color: #2d2d2d;
}

/* ── Cart summary — full width ────────────────────────────── */
#edd_checkout_cart_wrap {
    margin-bottom: 0;
}

#edd_checkout_cart {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    overflow: hidden;
}

#edd_checkout_cart thead th {
    background: #f9f9f9;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #999;
    padding: 10px 20px;
    text-align: left;
    border-bottom: 1px solid #e4e4e4;
}

#edd_checkout_cart thead th:last-child { text-align: right; }

#edd_checkout_cart tbody td {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 14px;
}

#edd_checkout_cart tbody tr:last-child td { border-bottom: none; }

#edd_checkout_cart .edd_cart_item_name a {
    color: #2d2d2d;
    text-decoration: none;
    font-weight: 500;
}
#edd_checkout_cart .edd_cart_item_name a:hover { color: #555; }

#edd_checkout_cart td.edd_cart_item_price,
#edd_checkout_cart td.edd_cart_actions {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.edd_cart_remove_item_btn {
    color: #ccc;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.15s;
}
.edd_cart_remove_item_btn:hover { color: #e05555; }

#edd_checkout_cart tfoot th {
    padding: 12px 20px;
    font-size: 14px;
}

th.edd_cart_total {
    border-top: 1px solid #e4e4e4;
    font-weight: 700;
    font-size: 15px;
    text-align: right;
}

/* ── Discount code — full width, below cart ───────────────── */
#edd_discount_code {
    border: 1px solid #e4e4e4;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 12px 20px;
    background: #fafafa;
    margin-bottom: 28px;
}

#edd_discount_code legend {
    display: none; /* hide "Discount Code" legend, use placeholder instead */
}

#edd_discount_code input[type="text"] {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 200px;
    margin-right: 6px;
    box-sizing: border-box;
}

#edd_discount_code input[type="submit"] {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    background: #f2f2f2;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
#edd_discount_code input[type="submit"]:hover { background: #e6e6e6; }

/* ── Prevent layout jerk while JS builds columns ──────────── */
#edd_purchase_form {
    opacity: 0;
    transition: opacity 0.15s ease;
}
#edd_purchase_form.ecc-ready {
    opacity: 1;
}

/* ── Two-column layout ────────────────────────────────────── */
.ecc-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.ecc-col-left  { min-width: 0; }
.ecc-col-right { min-width: 0; }

/* ── Section headings / legends ───────────────────────────── */
#edd_checkout_form_wrap legend,
#edd_checkout_form_wrap h3 {
    font-size: 15px;
    font-weight: 700;
    color: #2d2d2d;
    display: block;
    width: 100%;
    margin: 0 0 18px;
    padding: 0 0 10px;
    border-bottom: 1px solid #efefef;
    float: none;
}

/* ── Left column fieldsets ────────────────────────────────── */
#edd_checkout_user_info,
#edd_cc_address {
    border: none;
    padding: 0;
    margin: 0 0 28px;
}

/* ── Right column fieldsets ───────────────────────────────── */
#edd_cc_fields {
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 16px;
    background: #fff;
}

#edd_purchase_submit {
    border: none;
    padding: 0;
    margin: 0;
}

/* ── Override EDD's built-in 70% width on inputs ─────────── */
#edd_checkout_form_wrap input.edd-input,
#edd_checkout_form_wrap select.edd-select,
#edd_checkout_form_wrap textarea.edd-input {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ── Override EDD + Impreza padding/line-height on inputs ─── */
#edd_checkout_user_info input[type="text"],
#edd_checkout_user_info input[type="email"],
#edd_checkout_user_info input[type="tel"],
#edd_checkout_user_info input[type="password"],
#edd_cc_address input[type="text"],
#edd_cc_address input[type="email"],
#edd_cc_address input[type="tel"],
#edd_cc_address select {
    padding: 6px 10px !important;
    line-height: 1.4 !important;
    height: auto !important;
    font-size: 13px !important;
}

#edd_checkout_form_wrap .edd-form-group,
#edd_checkout_form_wrap p { margin-bottom: 8px; }

#edd_checkout_form_wrap label,
#edd_checkout_form_wrap .edd-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 2px;
}

/* Hide the helper description text to tighten up vertical space */
#edd_checkout_form_wrap .edd-description,
#edd_checkout_form_wrap .description {
    display: none;
}

#edd_checkout_form_wrap input[type="text"],
#edd_checkout_form_wrap input[type="email"],
#edd_checkout_form_wrap input[type="tel"],
#edd_checkout_form_wrap input[type="password"],
#edd_checkout_form_wrap select,
#edd_checkout_form_wrap textarea {
    width: 100%;
    padding: 7px 11px;
    font-size: 13px;
    color: #2d2d2d;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 7px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

#edd_checkout_form_wrap input[type="text"]:focus,
#edd_checkout_form_wrap input[type="email"]:focus,
#edd_checkout_form_wrap input[type="tel"]:focus,
#edd_checkout_form_wrap input[type="password"]:focus,
#edd_checkout_form_wrap select:focus,
#edd_checkout_form_wrap textarea:focus {
    outline: none;
    border-color: #aaa;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

#edd_checkout_form_wrap select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ── Stripe card element ──────────────────────────────────── */
#edd_secure_site_wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #999;
    margin-bottom: 14px;
    line-height: 1.5;
}

#edd-stripe-card-element,
.StripeElement {
    padding: 10px 13px;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 14px;
    min-height: 40px;
}

#edd-stripe-card-element:focus-within,
.StripeElement--focus {
    border-color: #aaa;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

/* ── Privacy / terms ──────────────────────────────────────── */
#edd-privacy-policy-agreement {
    border: none;
    padding: 0;
    margin: 0 0 14px;
}

.edd-privacy-policy-agreement {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #555;
}

#edd-agree-to-privacy-policy {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #4a90d9;
    cursor: pointer;
}

.edd-privacy-policy-agreement label {
    font-weight: 400;
    font-size: 13px;
    margin: 0;
    cursor: pointer;
}

/* ── Log in link ──────────────────────────────────────────── */
#edd-login-account-wrap {
    text-align: right;
    margin-bottom: 16px;
}

#edd-login-account-wrap a {
    font-size: 13px;
    font-weight: 600;
    color: #4a90d9;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid #d0e4f7;
    border-radius: 6px;
    display: inline-block;
    transition: background 0.15s;
}
#edd-login-account-wrap a:hover { background: #f0f7ff; }

/* ── Purchase total ───────────────────────────────────────── */
#edd_final_total_wrap {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 12px;
    padding: 12px 0;
    border-top: 1px solid #efefef;
}

/* ── Purchase button ──────────────────────────────────────── */
#edd_purchase_submit input[type="submit"],
#edd_purchase_submit button[type="submit"] {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: #4a90d9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: block;
}

#edd_purchase_submit input[type="submit"]:hover,
#edd_purchase_submit button[type="submit"]:hover { background: #3a7fc1; }

#edd_purchase_submit input[type="submit"]:disabled,
#edd_purchase_submit button[type="submit"]:disabled {
    background: #b0c8e8;
    cursor: not-allowed;
}

/* ── Notices ──────────────────────────────────────────────── */
.edd_errors { list-style: none; padding: 0; margin: 0 0 20px; }

.edd_errors li {
    background: #fff4f4;
    border: 1px solid #f5c6c6;
    color: #c0392b;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 7px;
    margin-bottom: 6px;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media ( max-width: 780px ) {
    .ecc-columns { grid-template-columns: 1fr; }
    #edd_checkout_cart thead { display: none; }
    #edd_checkout_cart tbody td { display: block; padding: 8px 14px; }
}
