/* ===== CART FIXES - IMAGE AND COLUMN ALIGNMENT ===== */

/* Fix for NO IMAGE placeholder visibility issues */
.item-image {
    position: relative !important;
    overflow: hidden !important;
    background: white !important;
    border-radius: 12px !important;
    border: 2px solid #e2e8f0 !important;
}

/* Ensure real product images are displayed properly */
.item-image img[src]:not([src=""]):not([src*="no-image"]):not([src*="NO-IMAGE"]):not([src*="placeholder"]) {
    position: relative !important;
    z-index: 15 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    background: white !important;
    display: block !important;
    border-radius: 10px !important;
}

/* Hide NO IMAGE placeholder when real image exists */
.item-image:has(img[src]:not([src=""]):not([src*="no-image"]):not([src*="NO-IMAGE"])) .no-image-placeholder {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Fallback method for hiding placeholder */
.item-image img[src]:not([src=""]):not([src*="no-image"]):not([src*="NO-IMAGE"]) + .no-image-placeholder,
.item-image img[src]:not([src=""]):not([src*="no-image"]):not([src*="NO-IMAGE"]) ~ .no-image-placeholder {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Style the placeholder when no real image exists */
.no-image-placeholder {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 5 !important;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    color: #94a3b8 !important;
    font-size: 10px !important;
    text-align: center !important;
    font-weight: 500 !important;
    border-radius: 10px !important;
}

.no-image-placeholder i {
    font-size: 24px !important;
    margin-bottom: 4px !important;
    color: #cbd5e1 !important;
}

/* ===== PERFECT COLUMN ALIGNMENT FIXES ===== */

/* Force consistent flexbox layout */
.cart-header,
.cart-item {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 25px !important;
    padding-right: 25px !important;
}

/* Checkbox Column - Exact Alignment */
.cart-header .header-checkbox,
.cart-item .item-checkbox-wrapper {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    flex: 0 0 60px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin-right: 15px !important;
}

/* Product Column - Exact Alignment */
.cart-header .header-product,
.cart-item .item-product-wrapper {
    flex: 1 !important;
    min-width: 300px !important;
    max-width: none !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding-left: 0 !important;
    padding-right: 20px !important;
    margin-right: 20px !important;
}

/* Price Column - Exact Alignment */
.cart-header .header-price,
.cart-item .item-price-wrapper {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    flex: 0 0 120px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 10px !important;
    margin: 0 !important;
}

/* Quantity Column - Exact Alignment */
.cart-header .header-quantity,
.cart-item .item-quantity-wrapper {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    flex: 0 0 140px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 10px !important;
    margin: 0 !important;
}

/* Total Column - Exact Alignment */
.cart-header .header-total,
.cart-item .item-total-wrapper {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    flex: 0 0 120px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 10px !important;
    margin: 0 !important;
}

/* Actions Column - Exact Alignment */
.cart-header .header-actions,
.cart-item .item-actions-wrapper {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    flex: 0 0 80px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ===== ADDITIONAL STYLING IMPROVEMENTS ===== */

/* Ensure price text is properly aligned */
.item-price {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    width: 100% !important;
}

.current-price {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #dc2626 !important;
    text-align: center !important;
}

.original-price {
    font-size: 14px !important;
    color: #94a3b8 !important;
    text-decoration: line-through !important;
    text-align: center !important;
}

/* Ensure quantity controls are centered */
.item-quantity {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
}

/* Ensure total amount is centered */
.item-total {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #059669 !important;
    text-align: center !important;
    width: 100% !important;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .cart-header {
        display: none !important;
    }
    
    .cart-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
        padding: 20px 15px !important;
    }
    
    .cart-item > div {
        width: 100% !important;
        flex: none !important;
        min-width: auto !important;
        max-width: none !important;
        justify-content: space-between !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }
    
    .item-product-wrapper {
        justify-content: flex-start !important;
        border-bottom: none !important;
    }
    
    .item-checkbox-wrapper {
        justify-content: flex-start !important;
        border-bottom: none !important;
    }
    
    .item-actions-wrapper {
        justify-content: center !important;
        border-bottom: none !important;
        padding-top: 15px !important;
    }
}

/* ===== FORCE OVERRIDE ANY CONFLICTING STYLES ===== */
.cart-items .cart-item .item-image,
.shop-section .cart-item .item-image {
    position: relative !important;
    overflow: hidden !important;
    background: white !important;
}

.cart-items .cart-item .item-image img,
.shop-section .cart-item .item-image img {
    position: relative !important;
    z-index: 15 !important;
    display: block !important;
}

/* Hide any remaining NO IMAGE text elements */
.item-image *:contains("NO IMAGE"),
.item-image *:contains("no image"),
.item-image *[class*="no-image"]:not(.no-image-placeholder),
.item-image *[class*="NO-IMAGE"]:not(.no-image-placeholder) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ===== ULTRA HIGH PRIORITY COLUMN ALIGNMENT FIXES ===== */

/* Force exact alignment with !important and high specificity */
.cart-header.cart-header,
.cart-item.cart-item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    width: 100% !important;
    padding: 20px 25px !important;
    box-sizing: border-box !important;
}

/* Checkbox - Ultra specific */
.cart-header.cart-header .header-checkbox,
.cart-item.cart-item .item-checkbox-wrapper {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    flex: 0 0 60px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 15px 0 0 !important;
}

/* Product - Ultra specific */
.cart-header.cart-header .header-product,
.cart-item.cart-item .item-product-wrapper {
    flex: 1 !important;
    min-width: 300px !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 20px 0 0 !important;
}

/* Price - Ultra specific with exact positioning */
.cart-header.cart-header .header-price,
.cart-item.cart-item .item-price-wrapper {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    flex: 0 0 120px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 15px !important;
    position: relative !important;
}

/* Quantity - Ultra specific */
.cart-header.cart-header .header-quantity,
.cart-item.cart-item .item-quantity-wrapper {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    flex: 0 0 140px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 15px !important;
}

/* Total - Ultra specific */
.cart-header.cart-header .header-total,
.cart-item.cart-item .item-total-wrapper {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    flex: 0 0 120px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 15px !important;
}

/* Actions - Ultra specific */
.cart-header.cart-header .header-actions,
.cart-item.cart-item .item-actions-wrapper {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    flex: 0 0 80px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Override any existing CSS that might interfere */
.shop-section .cart-header,
.shop-section .cart-item,
#cart-content-container .cart-header,
#cart-content-container .cart-item {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

/* Force remove any transforms or positioning that might cause misalignment */
.cart-header > *,
.cart-item > * {
    transform: none !important;
    position: relative !important;
}

/* Ensure price column content is properly centered */
.item-price-wrapper .item-price,
.header-price {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.current-price,
.original-price {
    width: 100% !important;
    text-align: center !important;
    display: block !important;
}