/* Cart Page Custom Styles - Professional Layout */

/* Fix case sensitivity - Optech to optech */
.Optech-cart-section,
.optech-cart-section {
    padding: 80px 0 50px;
}

.Optech-cart-list,
.optech-cart-list {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(10, 22, 94, 0.06);
    border: 1px solid #f0f2f5;
    overflow-x: auto;
}

.Optech-cart-list table,
.optech-cart-list table {
    width: 100%;
    min-width: 600px;
}

.Optech-cart-list table thead tr,
.optech-cart-list table thead tr {
    border-bottom: 2px solid #f0f2f5;
}

.Optech-cart-list table thead tr th,
.optech-cart-list table thead tr th {
    padding: 16px 12px;
    font-weight: 600;
    font-size: 14px;
    color: #0a165e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.Optech-cart-list table tbody tr,
.optech-cart-list table tbody tr {
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.2s ease;
}

.Optech-cart-list table tbody tr:hover,
.optech-cart-list table tbody tr:hover {
    background: #f9fafb;
}

.Optech-cart-list table tbody tr td,
.optech-cart-list table tbody tr td {
    padding: 20px 12px;
    font-weight: 500;
    color: #0a165e;
    vertical-align: middle;
}

/* Product Thumbnail in Cart */
.Optech-cart-thumb,
.optech-cart-thumb {
    display: flex;
    align-items: center;
    gap: 16px;
}

.Optech-cart-thumb i,
.optech-cart-thumb i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.Optech-cart-thumb i:hover,
.optech-cart-thumb i:hover {
    background: #ef4444;
    color: #fff;
}

.Optech-cart-thumb img,
.optech-cart-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.Optech-cart-thumb h5,
.optech-cart-thumb h5 {
    font-size: 15px;
    font-weight: 600;
    color: #0a165e;
    margin: 0;
    line-height: 1.4;
}

.Optech-cart-thumb h5:hover,
.optech-cart-thumb h5:hover {
    color: #2b4dff;
}

/* Quantity Controls */
.Optech-product-number,
.optech-product-number {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    width: 130px;
}

.Optech-product-number span,
.optech-product-number span {
    width: 40px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.Optech-product-number span:hover,
.optech-product-number span:hover {
    background: #2b4dff;
    color: #fff;
}

.Optech-product-number input,
.optech-product-number input {
    width: 50px;
    height: 44px;
    border: none;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: #0a165e !important;
    background: #fff !important;
    pointer-events: auto;
    user-select: none;
    cursor: default;
}

.Optech-product-number input:focus,
.optech-product-number input:focus {
    outline: none;
}

/* Cart Total Section */
.Optech-cart-total,
.optech-cart-total {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(10, 22, 94, 0.06);
    border: 1px solid #f0f2f5;
    max-width: 400px;
    margin-left: auto;
}

.Optech-cart-total h5,
.optech-cart-total h5 {
    font-size: 18px;
    font-weight: 700;
    color: #0a165e;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f2f5;
}

.Optech-cart-total-item,
.optech-cart-total-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f0f2f5;
}

.Optech-cart-total-item:last-of-type,
.optech-cart-total-item:last-of-type {
    border-bottom: none;
}

.Optech-cart-total-item p,
.optech-cart-total-item p {
    margin: 0;
    font-size: 15px;
    color: #4b5563;
}

.Optech-cart-total-item p:last-child,
.optech-cart-total-item p:last-child {
    font-weight: 600;
    color: #0a165e;
}

.Optech-cart-total-item p span,
.optech-cart-total-item p span {
    font-size: 18px;
    font-weight: 700;
    color: #2b4dff;
}

/* Checkout Button */
.Optech-cart-total .Optech-default-btn,
.Optech-cart-total .optech-default-btn,
.optech-cart-total .Optech-default-btn,
.optech-cart-total .optech-default-btn {
    width: 100%;
    margin-top: 20px;
    justify-content: center;
    padding: 16px 24px;
    border-radius: 10px;
}

/* Empty Cart State */
.Optech-cart-section .text-center,
.optech-cart-section .text-center {
    background: #fff;
    border-radius: 16px;
    padding: 60px 40px;
    box-shadow: 0 2px 12px rgba(10, 22, 94, 0.06);
    border: 1px solid #f0f2f5;
}

.Optech-cart-section .text-center i,
.optech-cart-section .text-center i {
    color: #d1d5db;
}

.Optech-cart-section .text-center h3,
.optech-cart-section .text-center h3 {
    color: #0a165e;
    font-weight: 700;
}

/* Section Padding */
.Optech-section-padding,
.optech-section-padding {
    padding: 80px 0;
}

.Optech-section-padding-bottom,
.optech-section-padding-bottom {
    padding-bottom: 80px;
}

/* Responsive */
@media (max-width: 991px) {
    .Optech-cart-total,
    .optech-cart-total {
        max-width: 100%;
        margin-top: 40px;
    }

    .Optech-cart-thumb img,
    .optech-cart-thumb img {
        width: 60px;
        height: 60px;
    }
}

/* ========================================
   MOBILE CART - CARD LAYOUT
   ======================================== */
@media (max-width: 768px) {
    .Optech-cart-section,
    .optech-cart-section {
        padding: 40px 0 30px;
    }

    /* Remove scroll */
    .Optech-cart-list,
    .optech-cart-list {
        overflow-x: visible !important;
        overflow-y: visible !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Block display for table */
    .optech-cart-list table,
    .Optech-cart-list table {
        display: block !important;
        width: 100% !important;
        min-width: unset !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    /* Hide table header */
    .optech-cart-list table thead,
    .Optech-cart-list table thead {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }

    /* Block display for tbody */
    .optech-cart-list table tbody,
    .Optech-cart-list table tbody {
        display: block !important;
        width: 100% !important;
    }

    /* Each row becomes a card */
    .optech-cart-list table tbody tr,
    .Optech-cart-list table tbody tr {
        display: block !important;
        width: 100% !important;
        background: #fff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
        padding: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        position: relative !important;
        box-sizing: border-box !important;
    }

    /* All cells block */
    .optech-cart-list table tbody td,
    .Optech-cart-list table tbody td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        border: none !important;
        text-align: left !important;
    }

    /* Product cell */
    .optech-cart-list table tbody td:first-child,
    .Optech-cart-list table tbody td:first-child {
        margin-bottom: 15px !important;
        padding-bottom: 15px !important;
        border-bottom: 1px solid #eee !important;
    }

    /* Product thumbnail - block layout */
    .optech-cart-thumb,
    .Optech-cart-thumb {
        display: block !important;
        position: relative !important;
        padding-right: 35px !important;
    }

    /* Delete button absolute */
    .optech-cart-thumb i.delete-cart-item,
    .Optech-cart-thumb i.delete-cart-item,
    .optech-cart-thumb > i,
    .Optech-cart-thumb > i {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        width: 28px !important;
        height: 28px !important;
        background: #ff4444 !important;
        color: #fff !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 16px !important;
        z-index: 10 !important;
    }

    /* Product image float */
    .optech-cart-thumb img,
    .Optech-cart-thumb img {
        width: 70px !important;
        height: 70px !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        float: left !important;
        margin-right: 12px !important;
        margin-bottom: 10px !important;
    }

    /* Product name */
    .optech-cart-thumb a,
    .Optech-cart-thumb a {
        display: block !important;
        overflow: hidden !important;
    }

    .optech-cart-thumb h5,
    .Optech-cart-thumb h5 {
        font-size: 14px !important;
        line-height: 1.4 !important;
        margin: 0 0 5px 0 !important;
        word-wrap: break-word !important;
    }

    /* Cart Note Wrapper - CLEAR FLOAT */
    .optech-cart-thumb .cart-note-wrapper,
    .Optech-cart-thumb .cart-note-wrapper {
        clear: both !important;
        display: block !important;
        width: 100% !important;
        margin-top: 15px !important;
        padding-top: 12px !important;
        border-top: 1px dashed #ddd !important;
        float: none !important;
    }

    /* Price, Qty, Subtotal rows */
    .optech-cart-list table tbody td:nth-child(2),
    .optech-cart-list table tbody td:nth-child(3),
    .optech-cart-list table tbody td:nth-child(4),
    .Optech-cart-list table tbody td:nth-child(2),
    .Optech-cart-list table tbody td:nth-child(3),
    .Optech-cart-list table tbody td:nth-child(4) {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
        border-top: 1px dashed #eee !important;
    }

    .optech-cart-list table tbody td:nth-child(2)::before,
    .Optech-cart-list table tbody td:nth-child(2)::before {
        content: "Harga" !important;
        font-weight: 600 !important;
        color: #555 !important;
        font-size: 13px !important;
    }

    .optech-cart-list table tbody td:nth-child(3)::before,
    .Optech-cart-list table tbody td:nth-child(3)::before {
        content: "Jumlah" !important;
        font-weight: 600 !important;
        color: #555 !important;
        font-size: 13px !important;
    }

    .optech-cart-list table tbody td:nth-child(4)::before,
    .Optech-cart-list table tbody td:nth-child(4)::before {
        content: "Subtotal" !important;
        font-weight: 600 !important;
        color: #555 !important;
        font-size: 13px !important;
    }

    .optech-cart-list table tbody td:nth-child(4),
    .Optech-cart-list table tbody td:nth-child(4) {
        font-weight: 700 !important;
        color: #0a165e !important;
        font-size: 15px !important;
    }

    /* Cart total section */
    .Optech-cart-total,
    .optech-cart-total {
        padding: 20px !important;
        margin-top: 10px !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .optech-cart-list table tbody tr,
    .Optech-cart-list table tbody tr {
        padding: 12px !important;
    }

    .optech-cart-thumb img,
    .Optech-cart-thumb img {
        width: 60px !important;
        height: 60px !important;
    }

    .optech-cart-thumb h5,
    .Optech-cart-thumb h5 {
        font-size: 13px !important;
    }
}
