/* Wishlist Table and Item Styles */

/* Wishlist items grid */
.wishlist-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.wishlist-item {
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    background: #fff;
    transition: all 0.3s ease;
}

.wishlist-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wishlist-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    border-radius: 4px;
}

.wishlist-remove-btn {
    margin-top: 10px;
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wishlist-remove-btn:hover {
    background-color: #d32f2f;
}

/* Header actions */
.ucp-header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* Modal close button - using unified style from _modals.css */
/* This avoids duplicate CSS for the same element */


/* Wishlist product details layout */
.ucp-product-item {
    width: 100%;
    position: relative;
    margin-bottom: 20px;
    overflow: visible;
}

.ucp-product-item .ucp-product-detail {
    width: 100%;
    clear: both;
    position: relative;
    overflow: hidden;
}

.ucp-product-item .ucp-product-detail .ucp-product-detail-container {
    width: 100%;
    padding: 15px;
    overflow: hidden;
}

.ucp-product-item .ucp-product-detail .ucp-product-summary {
    width: 100%;
    overflow: visible;
}
/* ==================== 
   Unified Table Styles System
   ==================== */

/* Container for tables */
#wishlist-container,
.ucp-table-container {
    width: 100%;
    box-sizing: border-box;
    padding-top: 20px;
    margin-bottom: 20px;
}

/* Base table styles */
.wishlist-table,
.ucp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto 20px;
    font-size: 14px;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: visible;
    max-width: 100%;
    background-color: #fff;
}

/* Table cells and headers */
.wishlist-table th,
.wishlist-table td,
.ucp-table th,
.ucp-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    line-height: 1.4;
    vertical-align: middle;
}

/* Table headers */
.wishlist-table th,
.ucp-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 5;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Table row hover */
.wishlist-table tr:hover,
.ucp-table tr:hover,
.wishlist-table tbody tr:hover {
    background-color: #f5f5f5;
    transition: background-color 0.2s ease;
}

/* Table action cells (buttons, controls) */
.wishlist-table .action-cell,
.ucp-table .action-cell {
    text-align: center;
    width: 100px;
}

/* Product image styles */
.wishlist-table .product-image img {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

/* Row number and SKU columns */
.wishlist-table .row-number,
.wishlist-table .sku {
    text-align: center;
    color: #666;
    font-family: monospace;
}

/* Product name column */
.wishlist-table .product-name {
    font-weight: 500;
    color: #333;
}

/* Action buttons */
.wishlist-table .action .ucp-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wishlist-table .action .ucp-btn-sm:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Alternate row colors */
.wishlist-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Responsive tables */
@media (max-width: 768px) {
    .wishlist-table,
    .ucp-table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    .wishlist-table th,
    .wishlist-table td,
    .ucp-table th,
    .ucp-table td {
        padding: 8px 10px;
        min-width: 100px;
    }
    
    .wishlist-table .product-image img {
        max-width: 50px;
    }
    
    .wishlist-table .action .ucp-btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
}




/* 
* Hover styles now come from the unified button system 
* We keep legacy styling only for backward compatibility
*/

/* Close button now uses the unified button system defined in ucp-styles.css */

#wishlist-modal.ucp-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
}

/* 
 * Modal container styles moved to _modals.css
 * All modal container styling should be maintained there
 * This improves code organization and reduces duplication
 */

#wishlist-modal .ucp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

#wishlist-modal #wishlist-container {
    overflow: auto;
    height: calc(100% - 60px); 
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

/* 
 * Removed redundant table styles here - 
 * These styles have been unified in the table style system in _modals.css 
 */
body.has-wishlist-modal {
    overflow: hidden;
}

/* Force fullwidth container */
#wishlist-container {
    width: 100% !important;
    padding: 0 !important;
    margin-top: 6vh;
}

/* Set explicit width for table to ensure it fits container */
.wishlist-table {
    width: 96% !important; /* Slightly less than 100% to ensure margin */
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Hide horizontal overflow at highest level */
.fullscreen-modal {
    overflow: hidden !important;
}

/* Product image in wishlist table */
.wishlist-product-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
    border: 1px solid #eee;
}

/* Wishlist actions section */
.wishlist-actions {
    margin-top: 20px;
    text-align: center;
    padding: 10px;
}

/* All buttons now use the unified ucp-btn class system */

/* Status messages */
#wishlist-send-status {
    margin-bottom: 10px;
    min-height: 24px;
}

#wishlist-send-status .success {
    color: #4CAF50;
    font-weight: bold;
}

#wishlist-send-status .error {
    color: #f44336;
    font-weight: bold;
}

#wishlist-send-status .sending {
    color: #2196F3;
    font-weight: bold;
}

/* Animation for sending status */
@keyframes sendingPulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* Apply animation to send-wishlist-btn when it shows Sending... */
#send-wishlist-btn.disabled {
    animation: sendingPulse 1.5s infinite ease-in-out;
}

/* Make Add to Wishlist button have square top corners */
.ucp-add-to-wishlist-btn.ucp-btn {
    border-radius: 0 0 5px 5px; /* Only bottom corners are rounded */
    color: white;
}
