/* Product purchase layout. Scoped to the product page and checkout modals. */

.km-product-page .km-gallery,
.km-product-page .caorusel-box,
.km-product-page .slick-list,
.km-product-page .slick-track {
    max-width: 100%;
    min-width: 0;
}

.km-product-page .km-product-photo,
.km-product-page .xzoom {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.km-product-page .xzoom-gallery {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.km-product-page .km-qty {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.km-product-page .km-qty .input-group {
    width: auto;
    max-width: 100%;
    flex: 0 0 auto;
}

.km-product-page .km-qty .btn {
    min-width: 44px;
    min-height: 44px;
}

.km-buy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.km-buy-actions .km-buy-price {
    display: none;
}

.km-buy-actions .km-buy-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.km-buy-actions .add-to-cart,
.km-buy-actions .add-to-wishlist {
    min-height: 48px;
    width: 100%;
}

.km-buy-actions .add-to-cart {
    background: #F47F2F !important;
    border-color: #F47F2F !important;
    color: #fff !important;
}

.km-buy-actions .add-to-cart:disabled {
    background: #c5c5c5 !important;
    border-color: #c5c5c5 !important;
    color: #fff !important;
    cursor: not-allowed;
}

.km-buy-actions .add-to-wishlist {
    background: #fff !important;
    border: 1px solid #1d1d1b !important;
    color: #1d1d1b !important;
}

.km-buy-actions .add-to-wishlist.is-saved i {
    color: #c0392b;
}

html[data-theme="dark"] .km-buy-actions .add-to-wishlist {
    background: transparent !important;
    border-color: #e6e6e6 !important;
    color: #f3f3f3 !important;
}

html[data-theme="dark"] .km-buy-actions .add-to-wishlist i {
    color: #f3f3f3 !important;
}

html[data-theme="dark"] .km-buy-actions .add-to-wishlist.is-saved i {
    color: #e74c3c !important;
}

.km-buy-actions .add-to-cart.is-loading,
.km-buy-actions .add-to-wishlist.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

@media (min-width: 992px) {
    .km-product-page .eachsku > .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: flex-start;
        width: 100%;
    }

    .km-product-page .km-gallery,
    .km-product-page .eachsku > .row > .col-lg-5 {
        flex: 0 0 41.666667% !important;
        width: 41.666667% !important;
        max-width: 41.666667% !important;
        min-width: 0 !important;
    }

    .km-product-page .eachsku > .row > .col-lg-7 {
        flex: 0 0 58.333333% !important;
        width: 58.333333% !important;
        max-width: 58.333333% !important;
        min-width: 0 !important;
    }

    .km-product-page .km-product-photo,
    .km-product-page .xzoom {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 991.98px) {
    .km-product-page .eachsku > .row,
    .km-product-page > .container > .bg-white > .row {
        flex-wrap: wrap !important;
    }

    .km-product-page .km-gallery,
    .km-product-page .col-lg-3,
    .km-product-page .col-lg-5,
    .km-product-page .col-lg-7,
    .km-product-page .col-lg-9,
    .km-product-page .col-xl-9,
    .km-product-page .col-xl-3 {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
}

@media (max-width: 768px) {
    .km-product-page {
        padding-bottom: 0;
    }

    .body-wrap:has(.km-product-page) {
        padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px));
    }

    .km-product-page + section {
        margin-top: 0 !important;
    }

    .km-product-page .km-product-photo,
    .km-product-page .xzoom {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 320px;
        margin: 0 auto;
        object-fit: contain;
    }

    .km-product-page .caorusel-box {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }

    .km-product-page .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .km-product-page .xzoom-preview,
    .km-product-page .xzoom-source {
        display: none;
    }

    .km-product-page .product-title {
        font-size: 1.2rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .km-product-page .breadcrumb {
        margin-bottom: 8px;
    }

    .km-product-page .km-price-row {
        margin-top: 4px !important;
    }

    .km-product-page .km-price-row .col-2 {
        display: none;
    }

    .km-product-page .km-price-row .col-10 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .km-product-page .km-prices {
        display: flex;
        flex-direction: column-reverse;
    }

    .km-product-page .product-price {
        margin: 0;
        font-size: 1.7rem;
        line-height: 1.2;
    }

    .km-product-page .product-price-old {
        font-size: 0.95rem;
    }

    .km-product-page .product-description-wrapper hr {
        margin: 10px 0;
    }

    .km-product-page #delivery-mobile.sticky-top {
        position: static;
    }

    .km-product-page select,
    .km-product-page .select2-container {
        width: 100% !important;
        max-width: 100%;
        height: auto;
    }

    .km-product-page select {
        min-height: 44px;
    }

    .km-buy-actions {
        position: fixed;
        left: 0;
        right: auto;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        z-index: 2147482000;
        background: #fff;
        color: #1d1d1b;
        box-shadow: 0 -6px 18px rgba(22, 22, 22, 0.08);
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
        transform: none;
    }

    html[data-theme="dark"] .km-buy-actions {
        background: #161616;
        color: #f3f3f3;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
    }

    html[data-theme="dark"] .km-buy-actions .km-buy-price {
        color: #f3f3f3 !important;
    }

    body.modal-open .km-buy-actions {
        visibility: hidden;
        pointer-events: none;
    }

    .km-buy-actions .km-buy-price {
        display: block;
        flex: 1 0 100%;
        font-size: 1.15rem;
        font-weight: 700;
    }

    .km-buy-actions .add-to-wishlist,
    .km-buy-actions .add-to-cart {
        flex: 1 1 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    #GuestCheckout.modal.show,
    #addToCart.modal.show {
        left: 0 !important;
        right: auto !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    #GuestCheckout .modal-dialog,
    #addToCart .modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: 100% !important;
        margin: 0 auto !important;
    }

    #GuestCheckout .modal-dialog::before,
    #addToCart .modal-dialog::before {
        display: none !important;
        height: 0 !important;
        content: none !important;
    }

    #GuestCheckout .modal-content,
    #addToCart .modal-content {
        max-height: calc(100% - 8px);
        overflow-y: auto;
    }

    #GuestCheckout .modal-body,
    #addToCart .modal-body {
        padding: 16px;
    }

    #GuestCheckout .input-group,
    #GuestCheckout .form-group,
    #GuestCheckout .card-body {
        width: 100%;
        max-width: 100%;
    }

    #GuestCheckout input,
    #GuestCheckout .form-control {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        flex: 1 1 auto;
    }

    #GuestCheckout .input-group {
        display: flex;
        flex-wrap: nowrap;
    }

    #GuestCheckout .btn,
    #addToCart .btn {
        max-width: 100%;
        white-space: normal;
    }

    #GuestCheckout .text-right,
    #addToCart .text-center {
        text-align: center;
    }

    #GuestCheckout .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 8px;
    }
}

@media (max-width: 768px) {
    .km-cart-page .container {
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100%;
    }

    .km-cart-page .form-default.bg-white.p-4 {
        padding: 12px;
    }

    .km-cart-page .product-name,
    .km-cart-page .product-total,
    .km-cart-page .cart-title {
        overflow-wrap: anywhere;
    }

    .km-cart-page .product-image img {
        width: 96px;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

    .km-cart-page .coupon-form {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        float: none;
        gap: 8px;
    }

    .km-cart-page .coupon-form .form-group,
    .km-cart-page .coupon-form .form-control,
    .km-cart-page .coupon-form .btn {
        width: 100%;
        max-width: 100%;
        min-height: 48px;
    }

    .km-cart-page .row.align-items-center > .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: left;
        margin-bottom: 10px;
    }

    .km-cart-page .row.align-items-center > .col-6 .btn {
        display: block;
        width: 100%;
        min-height: 48px;
        white-space: normal;
    }

    .km-cart-page select,
    .km-cart-page .select2-container {
        max-width: 100%;
    }

    .km-cart-page .table-cart .input-group .btn {
        min-width: 28px;
        min-height: 32px;
        padding: 0;
    }
}

@media (max-width: 991.98px) {
    .km-cart-page .cart-content {
        overflow-x: auto;
    }

    .km-cart-page .table-cart {
        display: table !important;
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
    }

    .km-cart-page .table-cart thead {
        display: table-header-group !important;
    }

    .km-cart-page .table-cart tbody {
        display: table-row-group !important;
    }

    .km-cart-page .table-cart tr,
    .km-cart-page .table-cart tr.cart-item {
        display: table-row !important;
        border: 0 !important;
        border-bottom: 1px dashed #e7e7e7 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .km-cart-page .table-cart th,
    .km-cart-page .table-cart td,
    .km-cart-page .table-cart .d-none {
        display: table-cell !important;
        width: auto !important;
        max-width: none !important;
        text-align: center !important;
        vertical-align: middle !important;
        padding: 8px 2px !important;
        border: 0 !important;
        font-size: 11px;
        float: none !important;
    }

    .km-cart-page .table-cart thead th {
        font-size: 9px;
        letter-spacing: 0;
        line-height: 1.15;
        text-transform: uppercase;
        white-space: nowrap;
        padding-bottom: 8px !important;
        border-bottom: 1px solid #e7e7e7 !important;
        overflow-wrap: normal;
        word-break: normal;
    }

    .km-cart-page .table-cart th.product-image {
        font-size: 0;
    }

    .km-cart-page .table-cart .product-image {
        width: 10% !important;
        overflow: hidden;
    }

    .km-cart-page .table-cart .product-name {
        width: 42% !important;
        max-width: 42% !important;
        min-width: 0 !important;
        text-align: left !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    .km-cart-page .table-cart .product-price,
    .km-cart-page .table-cart .product-total {
        width: 14% !important;
    }

    .km-cart-page .table-cart .product-quantity,
    .km-cart-page .table-cart .product-quanity {
        width: 16% !important;
    }

    .km-cart-page .table-cart .product-remove {
        width: 4% !important;
    }

    .km-cart-page .table-cart .product-image a {
        margin: 0 !important;
        display: block;
    }

    .km-cart-page .table-cart .product-image img {
        width: 36px;
        height: 36px;
        max-width: 100%;
        object-fit: cover;
    }

    .km-cart-page .table-cart .km-cart-title,
    .km-cart-page .table-cart .km-cart-variant {
        padding-right: 0 !important;
    }

    .km-cart-page .table-cart .input-group,
    .km-cart-page .table-cart .input-group--style-2 {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto;
        padding-right: 0 !important;
    }

    .km-cart-page .table-cart .input-group .form-control {
        width: 24px !important;
        min-width: 0 !important;
        flex: 1 1 auto;
        padding: 0 !important;
        text-align: center;
    }

    .km-cart-page .table-cart .input-group .btn,
    .km-cart-page .table-cart .input-group .input-group-btn {
        flex: 0 0 22px;
        width: 22px !important;
        min-width: 22px !important;
    }

    .km-cart-page .table-cart .product-remove i {
        margin: 0 !important;
        font-size: 18px !important;
    }
}

.km-cart-page .km-cart-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    line-height: 1.3;
    max-height: 2.6em;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    color: inherit !important;
    text-decoration: none;
    font-weight: 700;
}

.km-cart-page .km-cart-variant {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    color: inherit;
    word-break: normal;
    overflow-wrap: break-word;
}
