/**
 * NovaEdu checkout/cart layout fixes.
 */

/* General page spacing */
body.woocommerce-cart .site-content,
body.woocommerce-checkout .site-content,
body.woocommerce-cart .content-area,
body.woocommerce-checkout .content-area,
body.woocommerce-cart main,
body.woocommerce-checkout main {
    padding-left: 24px;
    padding-right: 24px;
}

body.woocommerce-cart .woocommerce,
body.woocommerce-checkout .woocommerce {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

/* Cart */
body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-cart .cart-collaterals {
    margin-top: 28px;
}

body.woocommerce-cart table.shop_table {
    border-collapse: collapse;
}

body.woocommerce-cart .cart_totals,
body.woocommerce-cart .cart-collaterals .cart_totals {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
}

/* Checkout notices/coupon/login bars */
body.woocommerce-checkout .woocommerce-form-coupon-toggle,
body.woocommerce-checkout .woocommerce-form-login-toggle,
body.woocommerce-checkout .woocommerce-notices-wrapper {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

/*
 * Checkout layout.
 * We force Woo's separate heading + review block into a stable 2-column grid.
 */
body.woocommerce-checkout form.checkout {
    display: grid !important;
    grid-template-columns: minmax(0, 620px) minmax(320px, 430px) !important;
    grid-template-areas:
        "customer heading"
        "customer review" !important;
    column-gap: 48px !important;
    row-gap: 0 !important;
    align-items: start !important;
    max-width: 1120px !important;
    margin: 0 auto !important;
}

body.woocommerce-checkout #customer_details {
    grid-area: customer !important;
    width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce-checkout #order_review_heading {
    grid-area: heading !important;
    width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    margin: 0 0 28px 0 !important;
    padding: 0 !important;
    align-self: start !important;
}

body.woocommerce-checkout #order_review {
    grid-area: review !important;
    width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: start !important;
}

body.woocommerce-checkout .woocommerce-checkout-review-order {
    position: sticky;
    top: 24px;
    height: auto !important;
    min-height: 0 !important;
    align-self: start !important;
}

/* Kill theme/Woo column floats */
body.woocommerce-checkout .col2-set,
body.woocommerce-checkout .col-1,
body.woocommerce-checkout .col-2 {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
}

/* Billing fields */
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
    max-width: 620px;
}

body.woocommerce-checkout .form-row {
    margin-bottom: 18px;
}

body.woocommerce-checkout .form-row-first,
body.woocommerce-checkout .form-row-last {
    width: calc(50% - 12px) !important;
}

body.woocommerce-checkout .form-row-first {
    margin-right: 24px !important;
}

body.woocommerce-checkout .form-row-wide {
    clear: both;
}

/* Textareas */
body.woocommerce-checkout .novaedu-company-data textarea,
body.woocommerce-checkout .novaedu-certificate-notice textarea {
    min-height: 92px;
    resize: vertical;
}

/* Order review compactness */
body.woocommerce-checkout #order_review table.shop_table {
    margin-bottom: 20px;
}

body.woocommerce-checkout #order_review table.shop_table th,
body.woocommerce-checkout #order_review table.shop_table td {
    vertical-align: top;
}

body.woocommerce-checkout #payment {
    margin-top: 20px;
}

/* Hide unused additional section */
body.woocommerce-checkout .woocommerce-additional-fields {
    display: none;
}

/* Stripe/payment box should not stretch weirdly */
body.woocommerce-checkout #payment ul.payment_methods,
body.woocommerce-checkout #payment div.payment_box {
    width: 100%;
    box-sizing: border-box;
}

/* Responsive */
@media (max-width: 980px) {
    body.woocommerce-checkout form.checkout {
        display: block !important;
        max-width: 680px !important;
    }

    body.woocommerce-checkout .woocommerce-checkout-review-order {
        position: static;
    }

    body.woocommerce-checkout #order_review_heading {
        margin-top: 40px !important;
    }

    body.woocommerce-cart .cart_totals,
    body.woocommerce-cart .cart-collaterals .cart_totals {
        max-width: none;
    }
}

@media (max-width: 640px) {
    body.woocommerce-cart .site-content,
    body.woocommerce-checkout .site-content,
    body.woocommerce-cart .content-area,
    body.woocommerce-checkout .content-area,
    body.woocommerce-cart main,
    body.woocommerce-checkout main {
        padding-left: 16px;
        padding-right: 16px;
    }

    body.woocommerce-checkout .form-row-first,
    body.woocommerce-checkout .form-row-last {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

/**
 * NovaEdu checkout alignment hard-fix.
 * Align order summary content with billing form.
 */

body.woocommerce-checkout form.checkout {
    grid-template-columns: minmax(0, 610px) minmax(360px, 430px) !important;
    grid-template-areas:
        "customer orderpanel" !important;
    column-gap: 42px !important;
    align-items: start !important;
}

/* Put heading and review into the same visual right column */
body.woocommerce-checkout #order_review_heading {
    grid-area: orderpanel !important;
    align-self: start !important;
    margin: 0 0 22px 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

body.woocommerce-checkout #order_review {
    grid-area: orderpanel !important;
    align-self: start !important;
    margin: 70px 0 0 0 !important;
    padding: 0 !important;
}

/* Remove theme/Woo offsets inside the summary */
body.woocommerce-checkout #order_review .shop_table,
body.woocommerce-checkout #order_review table.shop_table,
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table {
    margin-top: 0 !important;
    margin-bottom: 22px !important;
}

body.woocommerce-checkout #order_review .woocommerce-checkout-review-order {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Compact order table */
body.woocommerce-checkout #order_review table.shop_table th,
body.woocommerce-checkout #order_review table.shop_table td {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
}

/* Keep the right panel visually close, not floating far away */
body.woocommerce-checkout .woocommerce-checkout-review-order {
    position: static !important;
}

/* If the payment block creates too much vertical mass, keep it compact */
body.woocommerce-checkout #payment {
    margin-top: 18px !important;
}

@media (max-width: 980px) {
    body.woocommerce-checkout form.checkout {
        display: block !important;
    }

    body.woocommerce-checkout #order_review {
        margin-top: 0 !important;
    }

    body.woocommerce-checkout #order_review_heading {
        margin-top: 40px !important;
    }
}

/**
 * NovaEdu cart page polish.
 * Cleaner spacing, centered layout, better UX proportions.
 */

body.woocommerce-cart .woocommerce {
    max-width: 1180px !important;
    margin: 56px auto 80px auto !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
}

/* Keep cart away from header/menu */
body.woocommerce-cart .site-main,
body.woocommerce-cart main,
body.woocommerce-cart .content-area,
body.woocommerce-cart .site-content {
    padding-top: 28px !important;
}

/* Main cart layout */
body.woocommerce-cart .woocommerce-cart-form {
    width: calc(100% - 440px) !important;
    max-width: 740px !important;
    float: left !important;
    margin-top: 0 !important;
}

body.woocommerce-cart .cart-collaterals {
    width: 390px !important;
    float: right !important;
    margin-top: 0 !important;
}

body.woocommerce-cart .cart-collaterals .cart_totals {
    width: 100% !important;
    max-width: 390px !important;
    margin-left: 0 !important;
    padding: 0 !important;
}

/* Product table visual cleanup */
body.woocommerce-cart table.shop_table {
    border: 0 !important;
    border-collapse: collapse !important;
    margin-bottom: 0 !important;
}

body.woocommerce-cart table.shop_table th {
    font-size: 15px !important;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #555;
    padding: 0 0 18px 0 !important;
    border-bottom: 1px solid #ddd !important;
}

body.woocommerce-cart table.shop_table td {
    padding: 26px 0 !important;
    border-bottom: 1px solid #e5e5e5 !important;
    vertical-align: middle !important;
}

body.woocommerce-cart table.shop_table .product-thumbnail {
    width: 92px !important;
    padding-right: 22px !important;
}

body.woocommerce-cart table.shop_table .product-thumbnail img {
    width: 72px !important;
    height: 72px !important;
    object-fit: cover;
    background: #f7f7f7;
}

body.woocommerce-cart table.shop_table .product-name {
    padding-left: 8px !important;
}

body.woocommerce-cart table.shop_table .product-name a,
body.woocommerce-cart table.shop_table .product-name {
    font-size: 18px !important;
    line-height: 1.45 !important;
}

body.woocommerce-cart table.shop_table .variation {
    margin-top: 6px !important;
    font-size: 14px !important;
    color: #666 !important;
}

body.woocommerce-cart table.shop_table .product-price,
body.woocommerce-cart table.shop_table .product-subtotal {
    font-size: 17px !important;
    white-space: nowrap;
}

/* Quantity and remove button */
body.woocommerce-cart .quantity {
    display: inline-flex;
    align-items: center;
}

body.woocommerce-cart .product-remove a.remove {
    font-size: 22px !important;
    color: #666 !important;
    text-decoration: none !important;
}

body.woocommerce-cart .product-remove a.remove:hover {
    color: #b32d2e !important;
}

/* Cart totals panel */
body.woocommerce-cart .cart_totals h2 {
    font-size: 18px !important;
    text-transform: uppercase;
    letter-spacing: .02em;
    margin: 0 0 18px 0 !important;
    padding-bottom: 18px !important;
    border-bottom: 1px solid #ddd !important;
}

body.woocommerce-cart .cart_totals table.shop_table {
    margin-bottom: 26px !important;
}

body.woocommerce-cart .cart_totals table.shop_table th,
body.woocommerce-cart .cart_totals table.shop_table td {
    padding: 18px 0 !important;
    border-bottom: 1px solid #e5e5e5 !important;
    font-size: 17px !important;
}

body.woocommerce-cart .cart_totals .order-total th,
body.woocommerce-cart .cart_totals .order-total td {
    font-size: 24px !important;
    font-weight: 700 !important;
}

/* Checkout button */
body.woocommerce-cart .wc-proceed-to-checkout {
    padding-top: 18px !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    width: 100% !important;
    min-height: 58px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 4px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

/* Coupon accordion/section spacing */
body.woocommerce-cart .coupon,
body.woocommerce-cart .cart_totals .coupon {
    margin-bottom: 18px !important;
}

/* Footer spacing after cart */
body.woocommerce-cart footer,
body.woocommerce-cart .site-footer {
    margin-top: 80px !important;
}

/* Tablet/mobile */
@media (max-width: 1024px) {
    body.woocommerce-cart .woocommerce {
        max-width: 760px !important;
        margin-top: 42px !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    body.woocommerce-cart .woocommerce-cart-form,
    body.woocommerce-cart .cart-collaterals {
        width: 100% !important;
        max-width: none !important;
        float: none !important;
    }

    body.woocommerce-cart .cart-collaterals {
        margin-top: 42px !important;
    }

    body.woocommerce-cart .cart-collaterals .cart_totals {
        max-width: none !important;
    }
}

@media (max-width: 640px) {
    body.woocommerce-cart .woocommerce {
        margin-top: 28px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.woocommerce-cart table.shop_table .product-thumbnail {
        display: none !important;
    }

    body.woocommerce-cart table.shop_table td {
        padding: 18px 0 !important;
    }

    body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
        font-size: 18px !important;
    }
}

/**
 * NovaEdu checkout top notices and coupon placement.
 */

/* More breathing room below header/menu */
body.woocommerce-checkout .woocommerce {
    margin-top: 46px !important;
}

/* Keep login notice at the top, but not glued to menu */
body.woocommerce-checkout .woocommerce-form-login-toggle {
    max-width: 1120px !important;
    margin: 0 auto 34px auto !important;
}

body.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info {
    margin: 0 !important;
    padding: 24px 28px !important;
    background: #f2f2f2 !important;
    border-left: 4px solid #2f73b8 !important;
}

/* Hide the original coupon gap if JS moves the coupon */
body.woocommerce-checkout .novaedu-order-coupon-panel .woocommerce-form-coupon-toggle {
    margin: 0 !important;
}

body.woocommerce-checkout .novaedu-order-coupon-panel .woocommerce-info {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    color: inherit !important;
}

/* Coupon panel inside order summary */
body.woocommerce-checkout .novaedu-order-coupon-panel {
    border-top: 1px solid #d9dfe7;
    border-bottom: 1px solid #d9dfe7;
    padding: 18px 0;
    margin: 0 0 22px 0;
}

body.woocommerce-checkout .novaedu-order-coupon-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

body.woocommerce-checkout .novaedu-order-coupon-body {
    font-size: 15px;
    line-height: 1.5;
}

body.woocommerce-checkout .novaedu-order-coupon-body a {
    font-weight: 600;
}

body.woocommerce-checkout .novaedu-order-coupon-panel form.checkout_coupon {
    display: block !important;
    margin: 14px 0 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

body.woocommerce-checkout .novaedu-order-coupon-panel form.checkout_coupon p {
    margin-bottom: 10px !important;
}

body.woocommerce-checkout .novaedu-order-coupon-panel form.checkout_coupon .form-row {
    width: 100% !important;
    float: none !important;
    margin: 0 0 10px 0 !important;
}

body.woocommerce-checkout .novaedu-order-coupon-panel form.checkout_coupon input.input-text {
    width: 100% !important;
    min-height: 46px;
}

body.woocommerce-checkout .novaedu-order-coupon-panel form.checkout_coupon button {
    width: 100% !important;
    min-height: 46px;
}

/* If old coupon toggle somehow remains above checkout, hide only the empty spacing after JS move */
body.woocommerce-checkout > .woocommerce-form-coupon-toggle:empty {
    display: none !important;
}

@media (max-width: 980px) {
    body.woocommerce-checkout .woocommerce {
        margin-top: 30px !important;
    }

    body.woocommerce-checkout .woocommerce-form-login-toggle {
        margin-bottom: 24px !important;
    }
}

/**
 * NovaEdu coupon toggle fix.
 */

body.woocommerce-checkout .novaedu-coupon-form-hidden {
    display: none !important;
}

body.woocommerce-checkout .novaedu-coupon-form-visible {
    display: block !important;
}

body.woocommerce-checkout .novaedu-order-coupon-panel {
    border-top: 1px solid #d9dfe7;
    border-bottom: 1px solid #d9dfe7;
    padding: 20px 0;
    margin: 0 0 24px 0;
}

body.woocommerce-checkout .novaedu-order-coupon-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

body.woocommerce-checkout .novaedu-order-coupon-panel .woocommerce-info {
    font-size: 15px !important;
    line-height: 1.5 !important;
}

body.woocommerce-checkout .novaedu-order-coupon-panel form.checkout_coupon {
    margin-top: 16px !important;
}

body.woocommerce-checkout .novaedu-order-coupon-panel form.checkout_coupon input.input-text {
    margin-bottom: 10px !important;
}

/**
 * NovaEdu order received / thank you page.
 */

body.woocommerce-order-received .woocommerce {
    max-width: 1040px !important;
    margin: 56px auto 90px auto !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
}

body.woocommerce-order-received .woocommerce-order {
    background: #fff;
    border: 1px solid #dfe5ec;
    border-radius: 14px;
    padding: 42px 48px 48px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

body.woocommerce-order-received .woocommerce-notice--success,
body.woocommerce-order-received .woocommerce-thankyou-order-received {
    font-size: 24px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin: 0 0 30px 0 !important;
    padding: 0 0 24px 0 !important;
    border-bottom: 1px solid #e5eaf0;
}

body.woocommerce-order-received ul.order_details,
body.woocommerce-order-received .woocommerce-order-overview {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 42px 0 !important;
    padding: 0 !important;
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
}

body.woocommerce-order-received ul.order_details li,
body.woocommerce-order-received .woocommerce-order-overview li {
    list-style: none !important;
    margin: 0 !important;
    padding: 18px 20px !important;
    border-right: 1px solid #e0e6ed;
    border-bottom: 0 !important;
    text-transform: none !important;
    font-size: 13px !important;
    color: #6b7280 !important;
}

body.woocommerce-order-received ul.order_details li:last-child,
body.woocommerce-order-received .woocommerce-order-overview li:last-child {
    border-right: 0;
}

body.woocommerce-order-received ul.order_details li strong,
body.woocommerce-order-received .woocommerce-order-overview li strong {
    display: block !important;
    margin-top: 6px;
    font-size: 18px !important;
    line-height: 1.3 !important;
    color: #1f2937 !important;
    font-weight: 700 !important;
}

body.woocommerce-order-received .woocommerce-order-details,
body.woocommerce-order-received .woocommerce-customer-details {
    margin-top: 38px !important;
}

body.woocommerce-order-received .woocommerce-order-details__title,
body.woocommerce-order-received .woocommerce-column__title,
body.woocommerce-order-received h2 {
    font-size: 28px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 20px 0 !important;
}

body.woocommerce-order-received table.shop_table {
    border: 1px solid #e0e6ed !important;
    border-radius: 10px;
    overflow: hidden;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 0 !important;
}

body.woocommerce-order-received table.shop_table th,
body.woocommerce-order-received table.shop_table td {
    padding: 18px 20px !important;
    border-bottom: 1px solid #e5eaf0 !important;
    border-right: 0 !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
}

body.woocommerce-order-received table.shop_table thead th {
    background: #f8fafc;
    color: #374151;
    font-weight: 700 !important;
}

body.woocommerce-order-received table.shop_table tr:last-child th,
body.woocommerce-order-received table.shop_table tr:last-child td {
    border-bottom: 0 !important;
}

body.woocommerce-order-received table.shop_table tfoot th,
body.woocommerce-order-received table.shop_table tfoot td {
    background: #fbfdff;
    font-weight: 700 !important;
}

body.woocommerce-order-received address {
    border: 1px solid #e0e6ed !important;
    border-radius: 10px !important;
    padding: 22px 24px !important;
    background: #f8fafc;
    line-height: 1.7 !important;
    font-style: normal !important;
    color: #374151 !important;
}

body.woocommerce-order-received .woocommerce-customer-details--phone,
body.woocommerce-order-received .woocommerce-customer-details--email {
    margin-top: 8px !important;
}

@media (max-width: 860px) {
    body.woocommerce-order-received .woocommerce-order {
        padding: 30px 24px 34px;
    }

    body.woocommerce-order-received ul.order_details,
    body.woocommerce-order-received .woocommerce-order-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.woocommerce-order-received ul.order_details li:nth-child(2n),
    body.woocommerce-order-received .woocommerce-order-overview li:nth-child(2n) {
        border-right: 0;
    }

    body.woocommerce-order-received ul.order_details li:nth-child(-n+2),
    body.woocommerce-order-received .woocommerce-order-overview li:nth-child(-n+2) {
        border-bottom: 1px solid #e0e6ed !important;
    }
}

@media (max-width: 560px) {
    body.woocommerce-order-received .woocommerce {
        margin-top: 32px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.woocommerce-order-received .woocommerce-order {
        padding: 24px 18px 28px;
        border-radius: 10px;
    }

    body.woocommerce-order-received ul.order_details,
    body.woocommerce-order-received .woocommerce-order-overview {
        grid-template-columns: 1fr;
    }

    body.woocommerce-order-received ul.order_details li,
    body.woocommerce-order-received .woocommerce-order-overview li {
        border-right: 0 !important;
        border-bottom: 1px solid #e0e6ed !important;
    }

    body.woocommerce-order-received ul.order_details li:last-child,
    body.woocommerce-order-received .woocommerce-order-overview li:last-child {
        border-bottom: 0 !important;
    }
}
