/*
 * YJ 장바구니·결제 SAFE V0.2.1
 * 화면 전용. WooCommerce 장바구니/주문/PortOne/KG이니시스 로직 비변경.
 */

/* ===== YJ 장바구니 전용 프레임 ===== */
body.woocommerce-cart .entry-header,
body.woocommerce-cart .entry-title,
body.woocommerce-cart .page-title {
    display: none !important;
}

body.woocommerce-cart .site-content,
body.woocommerce-cart .content-area,
body.woocommerce-cart .site-main,
body.woocommerce-cart article,
body.woocommerce-cart .entry-content {
    overflow: visible;
}

.yj-cart-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 48px auto 84px;
    box-sizing: border-box;
}

body.admin-bar.woocommerce-cart .yj-cart-shell {
    margin-top: 64px;
}

.yj-cart-nav {
    width: 100%;
    margin: 0 0 28px;
    border: 1px solid #dfe6ee;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
}

.yj-cart-nav__inner {
    min-height: 58px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
}

.yj-cart-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 5px 18px;
    color: #17324d !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none !important;
    white-space: nowrap;
}

.yj-cart-nav__link:hover,
.yj-cart-nav__link:focus-visible {
    color: #0868b5 !important;
}

.yj-cart-nav__link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 6px;
}

.yj-cart-nav__sep {
    width: 1px;
    height: 18px;
    background: #d4dce5;
    flex: 0 0 1px;
}

.yj-cart-head {
    padding: 4px 4px 26px;
    border-bottom: 1px solid #dfe6ee;
    margin-bottom: 26px;
}

.yj-cart-head__eyebrow {
    margin: 0 0 6px;
    color: #0877bd;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
}

.yj-cart-head__title {
    margin: 0;
    color: #12395a;
    font-size: clamp(27px, 2.5vw, 36px);
    font-weight: 800;
    line-height: 1.25;
}

.yj-cart-head__desc {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.65;
}

/* WooCommerce Classic Cart를 YJ 교육과정 결제형으로 정리 */
.yj-cart-core > .woocommerce {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr);
    gap: 28px;
    align-items: start;
}

.yj-cart-core .woocommerce-notices-wrapper,
.yj-cart-core .woocommerce-message,
.yj-cart-core .woocommerce-info,
.yj-cart-core .woocommerce-error {
    grid-column: 1 / -1;
}

.yj-cart-core .woocommerce-cart-form {
    grid-column: 1;
    margin: 0;
}

.yj-cart-core .woocommerce-cart-form table.shop_table {
    margin: 0;
    border: 1px solid #dfe6ee;
    border-radius: 14px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
}

.yj-cart-core .woocommerce-cart-form table.shop_table thead th {
    padding: 15px 18px;
    background: #f6f9fc;
    color: #38536a;
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid #dfe6ee;
}

.yj-cart-core .woocommerce-cart-form table.shop_table td {
    padding: 22px 18px;
    color: #253a4b;
    vertical-align: middle;
    border-top: 0;
}

/* 교육과정에 상품 이미지가 없어도 깨진 placeholder가 보이지 않게 화면에서만 제거 */
.yj-cart-core th.product-thumbnail,
.yj-cart-core td.product-thumbnail {
    display: none !important;
}

.yj-cart-core td.product-name a {
    color: #153d5c;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
}

.yj-cart-core td.product-name dl.variation,
.yj-cart-core td.product-name .backorder_notification {
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
}

.yj-cart-core td.product-price,
.yj-cart-core td.product-subtotal {
    color: #153d5c;
    font-weight: 800;
    white-space: nowrap;
}

.yj-cart-core .quantity .qty {
    min-height: 40px;
    border: 1px solid #ccd6e0;
    border-radius: 8px;
    background: #fff;
}

.yj-cart-core td.product-remove a.remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    color: #64748b !important;
    background: #fff;
    font-size: 20px;
    line-height: 1;
}

.yj-cart-core td.product-remove a.remove:hover {
    color: #b42318 !important;
    background: #fff6f5;
}

.yj-cart-core .woocommerce-cart-form .actions {
    padding: 16px 18px !important;
    background: #fbfcfe;
    border-top: 1px solid #e4e9ef;
}

.yj-cart-core .coupon {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.yj-cart-core .coupon #coupon_code {
    min-width: 170px;
    min-height: 42px;
    border: 1px solid #ccd6e0;
    border-radius: 8px;
    padding: 0 12px;
}

.yj-cart-core button.button,
.yj-cart-core input.button {
    min-height: 42px;
    border-radius: 8px !important;
    font-weight: 700 !important;
}

.yj-cart-core .cart-collaterals {
    grid-column: 2;
    width: 100%;
    margin: 0;
}

.yj-cart-core .cart-collaterals .cart_totals {
    float: none;
    width: 100%;
    margin: 0;
    padding: 24px;
    border: 1px solid #dfe6ee;
    border-radius: 14px;
    background: #fff;
    box-sizing: border-box;
}

.yj-cart-core .cart_totals h2 {
    margin: 0 0 16px;
    color: #12395a;
    font-size: 20px;
    font-weight: 800;
}

.yj-cart-core .cart_totals table.shop_table {
    margin: 0 0 20px;
    border: 0;
}

.yj-cart-core .cart_totals table.shop_table th,
.yj-cart-core .cart_totals table.shop_table td {
    padding: 13px 0;
    border-top: 1px solid #e6ebf0;
}

.yj-cart-core .cart_totals .order-total th,
.yj-cart-core .cart_totals .order-total td {
    color: #12395a;
    font-size: 18px;
    font-weight: 800;
}

.yj-cart-core .wc-proceed-to-checkout {
    padding: 0;
}

.yj-cart-core .wc-proceed-to-checkout a.checkout-button {
    width: 100%;
    margin: 0;
    padding: 16px 20px;
    border-radius: 9px;
    background: #0877bd;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    box-shadow: none;
}

.yj-cart-core .wc-proceed-to-checkout a.checkout-button:hover,
.yj-cart-core .wc-proceed-to-checkout a.checkout-button:focus-visible {
    background: #075f98;
    color: #fff;
}

/* 추천상품은 상용화 직전 장바구니 화면에서 시각적으로만 숨김. 상품/데이터는 변경하지 않음. */
body.woocommerce-cart .cross-sells {
    display: none !important;
}

/* ===== 결제 페이지 미니 내비게이션 ===== */
.yj-commerce-mini-nav {
    width: min(1180px, calc(100% - 40px));
    margin: 34px auto 28px;
    border: 1px solid #dfe6ee;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
}

.yj-commerce-mini-nav__inner {
    min-height: 58px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
}

.yj-commerce-mini-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 5px 16px;
    color: #17324d !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none !important;
    white-space: nowrap;
}

.yj-commerce-mini-nav__link:hover,
.yj-commerce-mini-nav__link:focus-visible {
    color: #0868b5 !important;
}

.yj-commerce-mini-nav__link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 6px;
}

.yj-commerce-mini-nav__link--back {
    padding-left: 12px;
}

.yj-commerce-mini-nav__sep {
    width: 1px;
    height: 18px;
    background: #d4dce5;
    flex: 0 0 1px;
}

@media (max-width: 900px) {
    .yj-cart-shell {
        width: min(100% - 28px, 760px);
        margin-top: 32px;
        margin-bottom: 56px;
    }

    body.admin-bar.woocommerce-cart .yj-cart-shell {
        margin-top: 42px;
    }

    .yj-cart-core > .woocommerce {
        display: block;
    }

    .yj-cart-core .cart-collaterals {
        margin-top: 22px;
    }

    .yj-commerce-mini-nav {
        width: calc(100% - 28px);
    }
}

@media (max-width: 640px) {
    .yj-cart-nav,
    .yj-commerce-mini-nav {
        margin-bottom: 20px;
    }

    .yj-cart-nav__inner,
    .yj-commerce-mini-nav__inner {
        min-height: 50px;
        padding: 5px 8px;
        flex-wrap: wrap;
    }

    .yj-cart-nav__link,
    .yj-commerce-mini-nav__link {
        min-height: 38px;
        padding: 4px 10px;
        font-size: 14px;
    }

    .yj-cart-nav__sep,
    .yj-commerce-mini-nav__sep {
        height: 16px;
    }

    .yj-cart-head {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .yj-cart-head__desc {
        font-size: 14px;
    }

    .yj-cart-core .woocommerce-cart-form table.shop_table,
    .yj-cart-core .woocommerce-cart-form table.shop_table tbody,
    .yj-cart-core .woocommerce-cart-form table.shop_table tr,
    .yj-cart-core .woocommerce-cart-form table.shop_table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .yj-cart-core .woocommerce-cart-form table.shop_table thead {
        display: none;
    }

    .yj-cart-core .woocommerce-cart-form table.shop_table td {
        padding: 13px 16px;
        border-top: 1px solid #edf0f3;
        text-align: right;
    }

    .yj-cart-core .woocommerce-cart-form table.shop_table td::before {
        font-weight: 700;
    }

    .yj-cart-core .woocommerce-cart-form table.shop_table td.product-name {
        text-align: left;
        padding-top: 20px;
    }

    .yj-cart-core .woocommerce-cart-form table.shop_table td.product-remove {
        text-align: left;
        padding-bottom: 8px;
    }

    .yj-cart-core .woocommerce-cart-form .actions {
        display: block;
    }

    .yj-cart-core .coupon {
        width: 100%;
        margin-bottom: 10px;
    }

    .yj-cart-core .coupon #coupon_code {
        flex: 1 1 150px;
        min-width: 0;
    }

    .yj-cart-core .cart-collaterals .cart_totals {
        padding: 20px 16px;
    }
}
