/**
 * 1800 Doorbell - Cart Cross-Sells Styles
 * 
 * Styles for the "Frequently Bought Together" section on cart page
 * Extracted from Code Snippets Pro for better performance
 * 
 * Original location: code-snippets-styles.css Section 6 (lines 404-733)
 * Condition: is_cart()
 * 
 * @package 1800doorbell
 * @version 2.0.9
 */

/* ========================================
   CART THUMBNAIL FIXES
   ======================================== */

/* Fix for WooCommerce cart table thumbnails */
.woocommerce-cart-form .product-thumbnail img,
.woocommerce-cart-form__cart-item .product-thumbnail img {
    width: 60px !important;
    height: 60px !important;
    object-fit: contain !important;
    max-width: 100%;
    max-height: 100%;
}

.woocommerce-cart-form .product-thumbnail,
.woocommerce-cart-form__cart-item .product-thumbnail {
    width: 80px;
    max-width: 80px;
}

/* ========================================
   CROSS-SELLS CONTAINER
   ======================================== */

/* Main container */
.cross-sells-wrapper {
    margin: 2rem 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

/* ========================================
   TOGGLE BUTTON
   ======================================== */

.cross-sells-toggle {
    background: #fafafa;
    color: #333 !important;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 1.25rem 1.5rem;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    text-decoration: none !important;
}

.cross-sells-toggle:hover {
    background: #f5f5f5;
}

.cross-sells-toggle:focus {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

.cross-sells-toggle-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #333 !important;
}

.cross-sells-count {
    background: #666;
    color: white !important;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.cross-sells-toggle::after {
    content: '▼';
    font-size: 0.7rem;
    color: #666;
    transition: transform 0.3s ease;
    display: inline-block;
}

.cross-sells-toggle.active::after {
    transform: rotate(180deg);
}

/* ========================================
   COLLAPSIBLE CONTENT
   ======================================== */

.cross-sells-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: white;
}

.cross-sells-content.expanded {
    max-height: 4000px;
    transition: max-height 0.5s ease-in;
}

.cross-sells-form {
    padding: 1.5rem;
}

/* ========================================
   CROSS-SELLS TABLE
   ======================================== */

.cross-sells-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 1.5rem;
}

.cross-sells-table thead {
    background: #f9f9f9;
    border-bottom: 2px solid #e0e0e0;
}

.cross-sells-table th {
    padding: 0.875rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 0.813rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cross-sells-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.cross-sells-table tbody tr {
    transition: background-color 0.15s ease;
}

.cross-sells-table tbody tr:hover {
    background-color: #fafafa;
}

/* ========================================
   TABLE COLUMNS
   ======================================== */

/* Checkbox column */
.cross-sells-table th:first-child,
.cross-sells-table td:first-child {
    width: 40px;
    text-align: center;
}

.cross-sells-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    accent-color: #0073aa;
}

/* Image column */
.cross-sells-table th:nth-child(2),
.cross-sells-table td:nth-child(2) {
    width: 80px;
    text-align: center;
}

.cross-sells-table img {
    width: 60px !important;
    height: 60px !important;
    object-fit: contain !important;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    padding: 4px;
    background: white;
}

/* Product name column */
.cross-sells-table .product-name {
    font-weight: 500;
    line-height: 1.4;
}

.cross-sells-table .product-name a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cross-sells-table .product-name a:hover {
    color: #005a87;
}

/* SKU column */
.cross-sells-table td:nth-child(4) {
    color: #777;
    font-size: 0.813rem;
    font-family: 'Courier New', monospace;
}

/* Price column */
.cross-sells-table .price {
    font-weight: 600;
    color: #333;
    font-size: 0.938rem;
}

.cross-sells-table .price del {
    color: #999;
    font-weight: normal;
    margin-right: 0.5rem;
}

.cross-sells-table .price ins {
    text-decoration: none;
    color: #d26e4b;
}

/* Quantity column */
.cross-sells-table th:last-child,
.cross-sells-table td:last-child {
    width: 100px;
    text-align: center;
}

.cross-sells-table input[type="number"] {
    width: 60px !important;
    height: 36px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

.cross-sells-table input[type="number"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* ========================================
   BUTTONS
   ======================================== */

.cross-sells-form .button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.938rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
}

.cross-sells-form .button:hover {
    background: #005a87;
}

.cross-sells-form .button:active {
    background: #004a6f;
}

.cross-sells-button-wrapper {
    margin-bottom: 1.5rem;
}

.cross-sells-button-wrapper.bottom {
    margin-bottom: 0;
    margin-top: 0;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .cross-sells-wrapper {
        margin: 1.5rem 0;
        border-radius: 3px;
    }
    
    .cross-sells-toggle {
        padding: 1rem;
        font-size: 0.938rem;
    }

    .cross-sells-toggle-text {
        gap: 0.5rem;
    }

    .cross-sells-count {
        font-size: 0.688rem;
        padding: 2px 6px;
    }
    
    .cross-sells-form {
        padding: 1rem;
    }
    
    .cross-sells-table {
        font-size: 0.813rem;
    }
    
    .cross-sells-table th,
    .cross-sells-table td {
        padding: 0.625rem 0.375rem;
    }

    .cross-sells-table th:first-child,
    .cross-sells-table td:first-child {
        width: 35px;
    }

    .cross-sells-table th:nth-child(2),
    .cross-sells-table td:nth-child(2) {
        width: 50px;
    }
    
    .cross-sells-table img {
        width: 45px !important;
        height: 45px !important;
        padding: 2px;
    }
    
    .cross-sells-table input[type="number"] {
        width: 45px !important;
        height: 32px;
        font-size: 0.813rem;
        padding: 0.125rem 0.25rem;
    }
    
    /* Hide SKU column on mobile */
    .cross-sells-table th:nth-child(4),
    .cross-sells-table td:nth-child(4) {
        display: none;
    }
}
