/* ===== Custom Checkout Shortcode — checkout.css v1.4 ===== */

/* ── Font assignments (same as cart) ── */
.ccs-co-wrap h1, .ccs-co-wrap h2, .ccs-co-wrap h3, .ccs-co-wrap h4,
.ccs-co-form-title,
.ccs-co-summary-title,
.ccs-co-place-btn {
    font-family: 'Brice', 'Georgia', serif !important;
}
.ccs-co-wrap,
.ccs-co-wrap p, .ccs-co-wrap span, .ccs-co-wrap input,
.ccs-co-wrap label, .ccs-co-wrap button, .ccs-co-wrap a, .ccs-co-wrap strong {
    font-family: 'Galano Grotesque', 'Galano', 'Nunito Sans', sans-serif !important;
}

/* ── Reset ── */
.ccs-co-wrap *, .ccs-co-wrap *::before, .ccs-co-wrap *::after { box-sizing: border-box; }

/* ══════════════════════════════
   LAYOUT
══════════════════════════════ */
.ccs-co-wrap {
    display: grid;
    grid-template-columns: 1fr 420px;
    grid-template-areas: "left right";
    gap: 24px;
    align-items: start;
    padding: 20px 0;
    width: 100%;
}

@media (max-width: 960px) {
    .ccs-co-wrap {
        grid-template-columns: 1fr;
        grid-template-areas: "right" "left";
        gap: 16px;
    }
}

/* ══════════════════════════════
   LEFT — delivery form
══════════════════════════════ */
.ccs-co-left {
    grid-area: left;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.ccs-co-form-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.ccs-co-form-title {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #1a1a2e !important;
    margin: 0 0 24px 0 !important;
    line-height: 1.3;
}

/* Form grid rows */
.ccs-co-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.ccs-co-row-full {
    grid-template-columns: 1fr;
}

@media (max-width: 600px) {
    .ccs-co-row { grid-template-columns: 1fr; }
}

/* Field */
.ccs-co-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ccs-co-field label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1a1a2e !important;
}

.ccs-req { color: #e24b4a; margin-left: 2px; }

.ccs-co-field input[type="text"],
.ccs-co-field input[type="tel"],
.ccs-co-field input[type="email"] {
    width: 100%;
    border: 1.5px solid #e0e0e8 !important;
    border-radius: 10px !important;
    padding: 11px 14px !important;
    font-size: 14px !important;
    color: #333 !important;
    background: #fff !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.15s;
}

.ccs-co-field input:focus {
    border-color: #1a3a8f !important;
}

.ccs-co-field input::placeholder {
    color: #bbb !important;
}

/* Terms checkboxes */
.ccs-co-terms {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.ccs-co-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px !important;
    color: #444 !important;
    line-height: 1.5;
}

.ccs-co-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #1a3a8f;
    margin-top: 2px;
    cursor: pointer;
}

.ccs-co-check-label a {
    color: #1a3a8f !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}

/* Info block (Elementor) */
.ccs-co-info-block { width: 100%; }
.ccs-co-info-block > .elementor:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ══════════════════════════════
   RIGHT — order summary
══════════════════════════════ */
.ccs-co-right {
    grid-area: right;
    position: sticky;
    top: 20px;
    min-width: 0;
}

@media (max-width: 960px) {
    .ccs-co-right { position: static; }
}

.ccs-co-summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.ccs-co-summary-title {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #1a3a8f !important;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 4px 0 !important;
}

.ccs-co-delivery-date {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

.ccs-co-delivery-date strong {
    color: #1a1a2e;
    margin-left: 6px;
}

/* Items header */
.ccs-co-items-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 14px;
    color: #1a1a2e;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 4px;
}

/* Item row */
.ccs-co-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.ccs-co-item:last-of-type { border-bottom: none; }

.ccs-co-product {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ccs-co-img {
    width: 60px; height: 50px;
    border-radius: 8px; overflow: hidden;
    flex-shrink: 0; background: #f5f5f5;
}
.ccs-co-img img.ccs-co-thumb,
.ccs-co-img img {
    width: 60px; height: 50px;
    object-fit: cover; display: block;
}

.ccs-co-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ccs-co-item-name {
    font-weight: 700;
    font-size: 13px;
    color: #1a1a2e;
    line-height: 1.3;
    word-break: break-word;
}

.ccs-co-item-qty {
    font-size: 12px;
    color: #888;
}

.ccs-co-item-del button.ccs-co-del {
    width: 30px; height: 30px;
    border: 1.5px solid #e0e0e8;
    border-radius: 6px; background: #fff;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    color: #888; padding: 0;
    transition: all 0.15s;
}
.ccs-co-del:hover { border-color: #e24b4a; color: #e24b4a; background: #fff5f5; }

.ccs-co-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}

.ccs-co-price-cur {
    color: #1a3a8f;
    font-weight: 700;
    font-size: 14px;
}

.ccs-co-price-old {
    color: #aaa;
    text-decoration: line-through;
    font-size: 12px;
}

/* Coupon row */
.ccs-co-coupon-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 4px;
    background: #f8f8fb;
    border-radius: 10px;
    padding: 10px 12px;
}

.ccs-co-coupon-input {
    flex: 1; min-width: 0;
    border: none !important;
    background: transparent !important;
    font-size: 14px !important;
    color: #555 !important;
    outline: none !important;
    box-shadow: none !important;
}
.ccs-co-coupon-input[readonly] { color: #1a3a8f !important; font-weight: 600 !important; }

.ccs-co-coupon-sep { color: #ccc; flex-shrink: 0; }

.ccs-co-coupon-btn {
    background: none !important;
    border: none !important;
    color: #1a3a8f !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer; padding: 0 !important;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.ccs-co-coupon-btn:hover { opacity: 0.7; }

.ccs-co-applied {
    color: #1a9e5a !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}

.ccs-co-coupon-msg { font-size: 13px; margin: 0 0 6px !important; min-height: 16px; }
.ccs-co-coupon-msg.err { color: #e24b4a; }
.ccs-co-coupon-msg.ok  { color: #1a9e5a; }

/* Summary rows */
.ccs-co-sum-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #1a1a2e;
}
.ccs-co-sum-row strong { font-weight: 700; }
.ccs-co-sep { color: #aaa; }
.ccs-co-sum-row > span:last-child { margin-left: auto; font-weight: 600; }
.ccs-co-save { color: #e24b4a !important; font-weight: 700 !important; }

.ccs-co-total-row {
    font-size: 15px !important;
    border-top: 2px solid #e8e8e8 !important;
    border-bottom: none !important;
    padding-top: 12px !important;
    margin-top: 4px;
}

.ccs-co-free-ship {
    font-size: 12px;
    color: #1a9e5a;
    margin: 4px 0 8px !important;
}

/* ── Payment methods ── */
.ccs-co-payments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 0;
}

.ccs-co-payment-option {
    display: flex !important;
    align-items: center;
    gap: 12px;
    border: 1.5px solid #e0e0e8;
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1a1a2e !important;
    background: #fff;
    position: relative;
}

.ccs-co-payment-option:hover {
    border-color: #1a3a8f;
    background: #f8faff;
}

.ccs-co-payment-option.selected {
    border-color: #1a3a8f;
    background: #f0f4ff;
}

/* hide native radio */
.ccs-co-pay-radio {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

/* custom radio circle */
.ccs-co-pay-radio-custom {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid #c0c8e0;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s;
    background: #fff;
}

.ccs-co-payment-option.selected .ccs-co-pay-radio-custom {
    border-color: #1a3a8f;
    background: #1a3a8f;
    box-shadow: inset 0 0 0 3px #fff;
}

/* gateway icon */
.ccs-co-pay-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    color: #555;
}
.ccs-co-pay-icon img {
    width: auto !important;
    max-width: 28px !important;
    height: 22px !important;
    object-fit: contain;
    vertical-align: middle;
}

.ccs-co-pay-title { flex: 1; }

.ccs-co-no-gw { color: #e24b4a; font-size: 13px; padding: 8px 0; }

/* ── Place Order button ── */
.ccs-co-place-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    width: 100% !important;
    background: #e85d1a !important;
    border: none !important;
    color: #fff !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    padding: 15px !important;
    cursor: pointer;
    margin-top: 18px;
    transition: background 0.15s;
    letter-spacing: 0.02em;
}

.ccs-co-place-btn:hover { background: #c94b10 !important; }
.ccs-co-place-btn:disabled {
    background: #f0a070 !important;
    cursor: not-allowed;
}

.ccs-co-place-msg {
    font-size: 13px;
    margin: 8px 0 0 !important;
    min-height: 16px;
    text-align: center;
}
.ccs-co-place-msg.err { color: #e24b4a; }
.ccs-co-place-msg.ok  { color: #1a9e5a; font-weight: 600; }

/* ===== v1.5 Native WooCommerce checkout compatibility ===== */
.ccs-co-native-checkout .form-row {
    margin: 0 0 16px !important;
    padding: 0 !important;
}
.ccs-co-native-checkout .form-row-first,
.ccs-co-native-checkout .form-row-last {
    width: calc(50% - 8px) !important;
}
.ccs-co-native-checkout .form-row-first { float: left !important; }
.ccs-co-native-checkout .form-row-last { float: right !important; }
.ccs-co-native-checkout .form-row-wide { clear: both !important; width: 100% !important; }
.ccs-co-native-checkout label {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin-bottom: 6px !important;
}
.ccs-co-native-checkout abbr.required { color: #e24b4a !important; text-decoration: none !important; }
.ccs-co-native-checkout input.input-text,
.ccs-co-native-checkout textarea,
.ccs-co-native-checkout select,
.ccs-co-native-checkout .select2-container .select2-selection--single {
    width: 100% !important;
    min-height: 45px !important;
    border: 1.5px solid #e0e0e8 !important;
    border-radius: 10px !important;
    padding: 11px 14px !important;
    font-size: 14px !important;
    color: #333 !important;
    background: #fff !important;
    outline: none !important;
    box-shadow: none !important;
}
.ccs-co-native-checkout textarea { min-height: 90px !important; }
.ccs-co-native-checkout input.input-text:focus,
.ccs-co-native-checkout textarea:focus,
.ccs-co-native-checkout select:focus,
.ccs-co-native-checkout .select2-container--open .select2-selection--single {
    border-color: #1a3a8f !important;
}
.ccs-co-native-checkout .select2-container .select2-selection__rendered {
    line-height: 21px !important;
    padding: 0 !important;
}
.ccs-co-native-checkout .select2-container .select2-selection__arrow {
    height: 43px !important;
}
.ccs-co-native-checkout h3,
.ccs-co-native-checkout #ship-to-different-address {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #1a1a2e !important;
    margin: 18px 0 14px !important;
}
.ccs-co-native-checkout .woocommerce-billing-fields::after,
.ccs-co-native-checkout .woocommerce-shipping-fields::after,
.ccs-co-native-checkout .woocommerce-additional-fields::after,
.ccs-co-native-checkout .ccs-co-form-card::after {
    content: "";
    display: table;
    clear: both;
}

.ccs-co-shipping-methods {
    margin: 10px 0;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.ccs-co-shipping-methods th,
.ccs-co-shipping-methods td {
    display: block !important;
    width: 100% !important;
    border: none !important;
    padding: 4px 0 !important;
    font-size: 14px !important;
}
.ccs-co-shipping-methods ul#shipping_method {
    list-style: none !important;
    margin: 6px 0 0 !important;
    padding: 0 !important;
}
.ccs-co-shipping-methods ul#shipping_method li {
    margin: 6px 0 !important;
    padding: 0 !important;
}

.ccs-co-native-payment { margin-top: 18px; }
.ccs-co-native-payment #payment {
    background: transparent !important;
    border-radius: 0 !important;
}
.ccs-co-native-payment #payment ul.payment_methods {
    padding: 0 !important;
    border: 0 !important;
    margin: 0 0 14px !important;
}
.ccs-co-native-payment #payment ul.payment_methods li.wc_payment_method {
    list-style: none !important;
    border: 1.5px solid #e0e0e8 !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    margin: 0 0 10px !important;
    background: #fff !important;
    transition: border-color .15s, background .15s;
}
.ccs-co-native-payment #payment ul.payment_methods li.wc_payment_method.selected,
.ccs-co-native-payment #payment ul.payment_methods li.wc_payment_method:hover {
    border-color: #1a3a8f !important;
    background: #f8faff !important;
}
.ccs-co-native-payment #payment ul.payment_methods li label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
}
.ccs-co-native-payment #payment ul.payment_methods li img {
    max-height: 24px !important;
    width: auto !important;
    margin: 0 4px !important;
}
.ccs-co-native-payment .payment_box {
    background: #f7f8fb !important;
    color: #444 !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    margin: 10px 0 0 !important;
    font-size: 13px !important;
}
.ccs-co-native-payment .payment_box::before { display: none !important; }
.ccs-co-native-payment .place-order {
    padding: 0 !important;
    margin: 12px 0 0 !important;
}
.ccs-co-native-payment #place_order {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    background: #e85d1a !important;
    border: none !important;
    color: #fff !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    padding: 15px !important;
    margin-top: 12px !important;
    cursor: pointer;
    float: none !important;
}
.ccs-co-native-payment #place_order:hover { background: #c94b10 !important; }
.ccs-co-native-payment .woocommerce-terms-and-conditions-wrapper {
    font-size: 12px !important;
    line-height: 1.5;
    color: #555;
}

/* ===== Custom thank you page ===== */
.ccs-thankyou-wrap {
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 24px;
    align-items: start;
    padding: 20px 0;
}
.ccs-thankyou-main {
    background: #fff;
    border-radius: 24px;
    min-height: 520px;
    padding: 70px 40px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.ccs-thankyou-title {
    font-family: 'Brice', 'Georgia', serif !important;
    font-size: 38px !important;
    font-weight: 900 !important;
    color: #1a1a2e !important;
    margin: 0 0 42px !important;
}
.ccs-thankyou-title span { color: #12b886 !important; }
.ccs-thankyou-check {
    color: #12b886;
    font-size: 58px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 48px;
}
.ccs-thankyou-order-id {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 24px;
    margin-bottom: 42px;
}
.ccs-thankyou-order-id strong {
    font-weight: 900 !important;
    color: #000 !important;
}
.ccs-thankyou-order-id span {
    border: 4px solid #12b886;
    border-radius: 14px;
    padding: 6px 16px;
    font-weight: 700;
    color: #111;
}
.ccs-thankyou-message {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #1a1a2e !important;
    margin: 0 auto 90px !important;
    max-width: 780px;
}
.ccs-thankyou-note {
    max-width: 700px;
    margin: -60px auto 45px !important;
    color: #555;
}
.ccs-thankyou-actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}
.ccs-thankyou-help,
.ccs-thankyou-shop {
    min-width: 240px;
    border-radius: 12px;
    padding: 14px 28px;
    font-family: 'Brice', 'Georgia', serif !important;
    font-size: 23px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    line-height: 1;
}
.ccs-thankyou-help {
    color: #174586 !important;
    background: #fff !important;
    border: 3px solid #174586 !important;
}
.ccs-thankyou-shop {
    color: #fff !important;
    background: #e85d1a !important;
    border: 3px solid #e85d1a !important;
}
.ccs-thankyou-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.ccs-thankyou-summary { border-radius: 20px; }
.ccs-thankyou-info-block {
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.ccs-thankyou-gateway-message {
    max-width: 720px;
    margin: 30px auto 0;
    text-align: left;
}
.ccs-thankyou-gateway-message:empty { display: none; }

@media (max-width: 960px) {
    .ccs-co-native-checkout .form-row-first,
    .ccs-co-native-checkout .form-row-last {
        width: 100% !important;
        float: none !important;
    }
    .ccs-thankyou-wrap { grid-template-columns: 1fr; }
    .ccs-thankyou-main { min-height: auto; padding: 44px 18px; }
    .ccs-thankyou-title { font-size: 30px !important; }
    .ccs-thankyou-order-id { flex-direction: column; font-size: 20px; }
    .ccs-thankyou-message { margin-bottom: 45px !important; }
    .ccs-thankyou-help,
    .ccs-thankyou-shop { width: 100%; min-width: 0; }
}

/* ===== v1.6 fixes: stable checkout layout + native Woo gateway compatibility ===== */
.ccs-co-native-checkout {
    width: 100% !important;
    max-width: 1280px !important;
    margin: 0 auto !important;
    display: block !important;
}
.ccs-co-wrap {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px) !important;
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}
.ccs-co-right,
.ccs-co-summary-card {
    width: 100% !important;
    min-width: 360px !important;
    max-width: 420px !important;
}
.ccs-co-left {
    min-width: 0 !important;
}
.ccs-co-native-payment #payment ul.payment_methods li.wc_payment_method {
    overflow: hidden !important;
}
.ccs-co-native-payment #payment ul.payment_methods li label {
    width: 100% !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
    line-height: 1.35 !important;
}
.ccs-co-native-payment #payment ul.payment_methods li img {
    max-width: 105px !important;
    object-fit: contain !important;
}
.ccs-co-native-payment .payment_box,
.ccs-co-native-payment .payment_box * {
    max-width: 100% !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
}
.ccs-co-shipping-methods table,
.ccs-co-shipping-methods tbody,
.ccs-co-shipping-methods tr {
    display: block !important;
    width: 100% !important;
}
.ccs-co-shipping-methods label {
    display: inline !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}
.ccs-co-shipping-methods input[type="radio"] {
    margin-right: 6px !important;
}
@media (max-width: 960px) {
    .ccs-co-wrap { grid-template-columns: 1fr !important; padding-left: 12px !important; padding-right: 12px !important; }
    .ccs-co-right,
    .ccs-co-summary-card { min-width: 0 !important; max-width: 100% !important; }
}
