/**
 * EazyFast Custom Cart Styles (Tokopedia Inspired)
 * Clean, Minimalist, & Mobile Responsive
 */

.eazyfast-cart-container {
    max-width: 1200px;
    margin: 25px auto 40px auto;
    padding: 0 15px;
    font-family: "Open Sauce One", "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #212121;
    box-sizing: border-box;
}

.eazyfast-cart-container * {
    box-sizing: border-box;
}

/* Hide default Woodmart / WooCommerce cart notices */
.woocommerce-cart .entry-header,
.woocommerce-cart .woocommerce-notices-wrapper:empty,
.woocommerce-cart .wd-empty-block-title,
.woocommerce-cart .wd-empty-block-text,
.woocommerce-cart p.return-to-shop {
    display: none !important;
}

/* 2-Column Grid Layout */
.eazyfast-cart-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.eazyfast-cart-main {
    flex: 1;
    min-width: 0;
}

.eazyfast-cart-sidebar {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
}

/* Tokopedia Custom Checkbox */
.tokopedia-checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-size: 14px;
}

.tokopedia-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.tokopedia-checkbox-box {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1.8px solid #cdd5df;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
    background: #ffffff;
    flex-shrink: 0;
}

.tokopedia-checkbox-label input[type="checkbox"]:checked ~ .tokopedia-checkbox-box {
    background-color: #0f62fe;
    border-color: #0f62fe;
}

.tokopedia-checkbox-label input[type="checkbox"]:checked ~ .tokopedia-checkbox-box:after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Select All Header */
.tokopedia-cart-header {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.tokopedia-select-all-text {
    font-weight: 700;
    font-size: 14.5px;
    color: #212121;
}

/* Tokopedia Store Card */
.tokopedia-store-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    margin-bottom: 16px;
}

.tokopedia-store-header {
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
    background: #ffffff;
    display: flex;
    align-items: center;
}

.tokopedia-badge-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

.tokopedia-store-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #212121;
}

/* Product Rows */
.tokopedia-items-list {
    display: flex;
    flex-direction: column;
}

.tokopedia-product-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
    background: #ffffff;
}

.tokopedia-product-row:last-child {
    border-bottom: none;
}

.tokopedia-product-row.is-unselected {
    opacity: 0.6;
    background: #fafafa;
}

.tokopedia-item-check-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.tokopedia-item-thumb-col {
    width: 66px;
    height: 66px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.tokopedia-item-thumb-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Container Konten (Kanan dari foto: Atas & Bawah) */
.tokopedia-item-main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 66px;
    gap: 6px;
}

/* Baris Atas: Judul (75%) & Harga (25%) */
.tokopedia-row-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.tokopedia-item-title {
    flex: 0 0 75%;
    max-width: 75%;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    color: #212121;
}

.tokopedia-item-title a {
    color: #212121;
    text-decoration: none;
    transition: color 0.15s ease;
}

.tokopedia-item-title a:hover {
    color: #0f62fe;
}

.tokopedia-title-desktop {
    display: inline;
}

.tokopedia-title-mobile {
    display: none;
}

.tokopedia-item-price-wrap {
    flex: 0 0 25%;
    max-width: 25%;
    text-align: right;
    margin-bottom: 0;
    padding-right: 14px; /* Spasi sedikit dari sisi kanan */
}

.tokopedia-price-text {
    font-size: 16px;
    font-weight: 700;
    color: #008698;
}

/* Baris Bawah: Varian + Berat (kiri) & Tombol (kanan) */
.tokopedia-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.tokopedia-bottom-left {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px; /* Jarak antara varian dan berat */
}

.tokopedia-variant-name {
    font-size: 12px !important; /* Seukuran text 'berat :' */
    font-weight: 700;
    color: #212121;
    line-height: 1.3;
    display: inline-block;
}

.tokopedia-item-weight-badge {
    font-size: 12px !important;
    color: #8d96aa !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
}

.tokopedia-item-weight-val {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #64748b !important;
}

.tokopedia-item-sku-sep {
    color: #cbd5e1 !important;
    margin: 0 4px !important;
}

.tokopedia-item-sku-val {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #475569 !important;
}

.tokopedia-bottom-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding-right: 14px; /* Sejajar dengan info harga */
}

button.tokopedia-action-btn,
.tokopedia-action-btn {
    all: unset !important;
    box-sizing: border-box !important;
    width: 24px !important;
    height: 26px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #cdd5df !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #8d96aa !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
}

button.tokopedia-action-btn svg,
.tokopedia-action-btn svg {
    width: 13px !important;
    height: 13px !important;
    min-width: 13px !important;
    min-height: 13px !important;
    max-width: 13px !important;
    max-height: 13px !important;
    display: block !important;
    fill: currentColor !important;
    color: inherit !important;
    pointer-events: none !important;
}

button.tokopedia-action-btn:hover,
.tokopedia-action-btn:hover {
    background: #f8fafc !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

button.tokopedia-action-btn.btn-wishlist:hover,
.tokopedia-action-btn.btn-wishlist:hover {
    background: #eff6ff !important;
    border-color: #0f62fe !important;
    color: #0f62fe !important;
}

/* Stepper Pill Box */
.tokopedia-stepper-box {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cdd5df;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
    height: 26px;
}

.tokopedia-stepper-btn {
    width: 24px;
    height: 26px;
    border: none;
    background: #ffffff;
    color: #6d7588;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    user-select: none;
}

.tokopedia-stepper-btn:hover {
    color: #0f62fe;
    background: #f8fafc;
}

.tokopedia-stepper-input {
    width: 32px;
    height: 26px;
    border: none;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: #212121;
    -moz-appearance: textfield;
    padding: 0;
}

.tokopedia-stepper-input::-webkit-outer-spin-button,
.tokopedia-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Continue Shopping */
.eazyfast-cart-continue {
    margin-top: 18px;
}

.eazyfast-cart-continue-desktop {
    display: block;
}

.eazyfast-cart-continue-mobile {
    display: none;
}

.eazyfast-btn-outline-back {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    background: #fff;
    transition: all 0.2s ease;
}

.eazyfast-btn-outline-back:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Right Sidebar: Summary */
.eazyfast-summary-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.eazyfast-summary-title {
    font-size: 16px;
    font-weight: 700;
    color: #212121;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.eazyfast-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eazyfast-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
}

.eazyfast-summary-row .row-label {
    color: #6d7588;
}

.eazyfast-summary-row .row-val {
    font-weight: 600;
    color: #212121;
}

.eazyfast-summary-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

/* Row Harga Shopee (Teks Orange Tua, Nilai Harga Coret Merah) */
.ef-summary-shopee-row .row-label {
    color: #ea580c !important; /* Orange tua */
    font-size: 13.5px !important;
    font-weight: 700 !important;
}

.ef-shopee-strike {
    text-decoration: line-through !important;
    color: #dc2626 !important; /* Merah */
    font-weight: 600 !important;
    font-size: 13.5px !important;
}

.ef-shopee-strike .woocommerce-Price-amount {
    color: #dc2626 !important;
}

/* Row Anda Hemat (Teks Hitam, Nilai Hemat Hijau Tanpa Badge) */
.ef-summary-hemat-row .row-label {
    color: #212121 !important; /* Hitam */
    font-weight: 700 !important;
    font-size: 13.5px !important;
}

.ef-hemat-val {
    color: #16a34a !important; /* Hijau */
    font-weight: 700 !important;
    font-size: 14px !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

.ef-hemat-val .woocommerce-Price-amount {
    color: #16a34a !important;
}

.eazyfast-summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 18px;
}

.eazyfast-summary-total-row .total-label {
    font-size: 14.5px;
    font-weight: 700;
    color: #212121;
}

.eazyfast-summary-total-row .total-val {
    font-size: 20px;
    font-weight: 800;
    color: #0f62fe;
}

/* Checkout Button */
.eazyfast-btn-primary-checkout,
button#eazyfast-btn-checkout {
    width: 100%;
    background: #e8f1ff !important;
    color: #475569 !important;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s ease;
    display: block;
    text-align: center;
}

.eazyfast-btn-primary-checkout:hover:not(:disabled),
button#eazyfast-btn-checkout:hover:not(:disabled) {
    background: #0050b3 !important;
    color: #ffffff !important;
    border-color: #0050b3 !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(15, 98, 254, 0.35);
}

.eazyfast-btn-primary-checkout:disabled,
button#eazyfast-btn-checkout:disabled {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Trust Badges */
.eazyfast-cart-trust-badges {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6d7588;
}

.trust-icon {
    font-size: 14px;
}

/* Empty Cart State */
.eazyfast-cart-empty-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    max-width: 560px;
    margin: 40px auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.eazyfast-empty-icon {
    margin-bottom: 18px;
}

.eazyfast-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: #212121;
    margin: 0 0 10px 0;
}

.eazyfast-empty-desc {
    font-size: 14px;
    color: #6d7588;
    max-width: 400px;
    margin: 0 auto 24px auto;
    line-height: 1.5;
}

.eazyfast-btn-shop-now {
    display: inline-block;
    background: #0f62fe;
    color: #ffffff !important;
    font-size: 14.5px;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(15, 98, 254, 0.25);
}

.eazyfast-btn-shop-now:hover {
    background: #0050b3;
    transform: translateY(-1px);
}

/* Responsive Styles */
@media (max-width: 991px) {
    .eazyfast-cart-layout {
        flex-direction: column;
    }
    .eazyfast-cart-sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 640px) {
    .tokopedia-store-header {
        padding: 12px 14px !important;
    }

    .tokopedia-product-row {
        display: grid !important;
        grid-template-columns: auto 60px minmax(0, 1fr) auto !important;
        grid-template-rows: auto auto auto !important;
        row-gap: 6px !important;
        column-gap: 8px !important;
        padding: 12px 12px !important;
        align-items: center !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Checkbox & Foto di baris 1-2 */
    .tokopedia-item-check-col {
        grid-row: 1 / 3 !important;
        grid-column: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding-top: 0 !important;
        margin: 0 !important;
    }

    .tokopedia-item-thumb-col {
        grid-row: 1 / 3 !important;
        grid-column: 2 !important;
        width: 60px !important;
        height: 60px !important;
        margin: 0 !important;
    }

    /* Buka pembungkus flex agar anak-anaknya masuk ke CSS Grid */
    .tokopedia-item-main-content,
    .tokopedia-row-top,
    .tokopedia-row-bottom,
    .tokopedia-bottom-left {
        display: contents !important;
    }

    /* Baris 1: Judul di samping foto */
    .tokopedia-item-title {
        grid-row: 1 !important;
        grid-column: 3 / 5 !important;
        font-size: 13.5px !important;
        line-height: 1.35 !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        align-self: start !important;
    }

    .tokopedia-title-desktop {
        display: none !important;
    }

    .tokopedia-title-mobile {
        display: inline !important;
    }

    /* Baris 2: Nama Varian (kiri) & Harga (rata kanan, pas di dalam card) */
    .tokopedia-variant-name {
        grid-row: 2 !important;
        grid-column: 3 !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        color: #212121 !important;
        line-height: 1.3 !important;
        align-self: center !important;
        margin: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        justify-self: start !important;
    }

    .tokopedia-item-price-wrap {
        grid-row: 2 !important;
        grid-column: 4 !important;
        flex: none !important;
        max-width: 100% !important;
        text-align: right !important;
        justify-self: end !important;
        margin: 0 0 0 auto !important;
        padding: 0 !important;
        align-self: center !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    .tokopedia-price-text {
        font-size: 15px !important;
        font-weight: 700 !important;
        color: #008698 !important;
        display: inline-block !important;
        text-align: right !important;
        white-space: nowrap !important;
    }

    /* Baris 3: Info Berat (dimulai tepat di bawah foto) & Tombol Aksi (kanan) */
    .tokopedia-item-weight-badge {
        grid-row: 3 !important;
        grid-column: 2 / 4 !important;
        font-size: 12px !important;
        color: #8d96aa !important;
        margin: 0 !important;
        padding-top: 4px !important;
        align-self: center !important;
        white-space: nowrap !important;
        display: inline-flex !important;
    }

    .tokopedia-bottom-right {
        grid-row: 3 !important;
        grid-column: 4 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        padding-right: 0 !important;
        padding-top: 4px !important;
    }

    .eazyfast-cart-continue-desktop {
        display: none !important;
    }

    .eazyfast-cart-continue-mobile {
        display: block !important;
        margin-top: 12px !important;
        text-align: center !important;
    }

    .eazyfast-cart-continue-mobile .eazyfast-btn-outline-back {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
}
