/**
 * Custom CSS for Flexible Wishlist
 * Makes wishlist section 100% width and responsive with a beautiful design
 */

/* Global container override for wishlist page */
body.woocommerce-wishlist .container,
body.woocommerce-wishlist .content-area,
body.woocommerce-wishlist .site-content,
body.woocommerce-wishlist main,
body.woocommerce-wishlist #main,
body.woocommerce-wishlist #primary,
body.woocommerce-wishlist .page-container,
body.woocommerce-wishlist .page-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Special full width class */
.fw-full-width-container {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Target any parent container of our wishlist */
body .woocommerce-page,
body .content-area,
body main,
body #main,
body #primary,
body .site-content,
body .page,
body article {
    max-width: 100% !important;
    width: 100% !important;
}

/* Wishlist container styling */
.wishlist-container {
    width: 100% !important;
    max-width: 1200px !important;
    padding: 10px 20px;
    box-sizing: border-box;
    background-color: transparent;
    border-radius: 0;
    margin: 0 auto;
}

/* Wishlist form styling */
.wishlist-form {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
    background-color: #fff;
    border-radius: 0;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Table styling with our theme color */
.wishlist-table {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    table-layout: auto;
    border-collapse: collapse;
}

/* Table header styling - changed to white with refined styling */
.wishlist-table thead {
    background-color: white;
    border-bottom: 1px solid #f0f0f0;
}

.wishlist-table thead th {
    color: #333;
    padding: 8px 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8em;
    border: none;
}

/* Table body styling */
.wishlist-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.wishlist-table tbody tr:hover {
    background-color: rgba(206, 178, 131, 0.03);
}

/* Table cell styling */
.wishlist-table td {
    padding: 12px 15px;
    vertical-align: middle;
    word-break: break-word;
}

/* Product image styling */
.product-thumbnail img {
    width: 60px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    padding: 2px;
    background-color: #fff;
    transition: transform 0.2s ease;
}

.product-thumbnail img:hover {
    transform: scale(1.05);
}

/* Product name styling */
.product-name a {
    color: #333;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.95em;
}

.product-name a:hover {
    color: #CEB283;
}

.product-name small {
    color: #999;
    font-size: 0.8em;
    display: block;
    margin-top: 3px;
}

/* Product price styling */
.product-price {
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

.product-price ins {
    text-decoration: none;
    color: #CEB283;
    font-weight: 600;
}

.product-price del {
    color: #999;
    font-size: 0.85em;
}

/* Button styling - made smaller */
.wishlist-button,
.wishlist-note-button,
.wishlist-shop-button,
.wishlist-add-all-button {
    background-color: #CEB283 !important;
    color: white !important;
    border: none !important;
    padding: 5px 8px !important;
    border-radius: 3px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    box-shadow: none !important;
    font-size: 0.7em !important;
    line-height: 1.5 !important;
    min-height: 0 !important;
    height: auto !important;
}

.wishlist-button:hover,
.wishlist-note-button:hover,
.wishlist-shop-button:hover,
.wishlist-add-all-button:hover {
    opacity: 0.9 !important;
    background-color: #CEB283 !important;
    box-shadow: none !important;
    transform: translateY(-1px);
}

.wishlist-button:active,
.wishlist-note-button:active,
.wishlist-shop-button:active,
.wishlist-add-all-button:active {
    transform: translateY(0);
}

/* Remove button styling */
.product-remove a.remove {
    color: #999 !important;
    font-size: 1.3em;
    font-weight: 400;
    text-decoration: none;
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.product-remove a.remove:hover {
    color: white !important;
    background-color: #CEB283;
    transform: rotate(90deg);
}

/* Empty wishlist styling */
.empty-wishlist {
    text-align: center;
    padding: 40px 20px !important;
    background-color: transparent;
}

.empty-wishlist p {
    font-size: 1em;
    color: #777;
    margin-bottom: 15px;
}

/* Note form styling */
.wishlist-note-form {
    display: flex !important;
    margin-bottom: 10px;
}

.wishlist-note-form form {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
}

.wishlist-note-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 0.9em;
}

.wishlist-note-form input[type="text"]:focus {
    border-color: #CEB283;
    outline: none;
}

.wishlist-actions {
    padding: 12px 15px !important;
    background-color: #fafafa;
}

/* Quantity input styling */
.product-quantity input.qty {
    width: 50px;
    padding: 5px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
}

.product-quantity input.qty:focus {
    border-color: #CEB283;
    outline: none;
}

/* Add loading animation for buttons */
.wishlist-button.loading:after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 5px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ensure responsive behavior for mobile */
@media (max-width: 768px) {
    .wishlist-container {
        padding: 5px;
        background-color: transparent;
    }
    
    .wishlist-table {
        display: block;
        width: 100% !important;
        border: none;
    }
    
    .wishlist-table thead, 
    .wishlist-table tbody, 
    .wishlist-table tr {
        display: block;
        width: 100% !important;
    }
    
    .wishlist-table thead {
        display: none;
    }
    
    .wishlist-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100% !important;
        box-sizing: border-box;
        border-bottom: 1px solid #f0f0f0;
        padding: 8px;
    }
    
    .wishlist-table td::before {
        content: attr(data-title);
        font-weight: bold;
        margin-right: 10px;
        color: #333;
        font-size: 0.9em;
    }
    
    .product-thumbnail {
        justify-content: center !important;
        padding: 10px 8px !important;
    }
    
    .product-thumbnail::before {
        display: none;
    }
    
    .product-thumbnail img {
        width: 50px;
    }
    
    .wishlist-table .actions {
        display: block;
        padding: 10px !important;
    }
    
    .wishlist-table .actions::before {
        content: none;
    }
    
    .wishlist-note-form {
        flex-direction: column;
        width: 100% !important;
    }
    
    .wishlist-note-form input, 
    .wishlist-note-form button {
        width: 100% !important;
        margin: 5px 0;
    }
    
    .wishlist-add-all-button {
        width: 100%;
        margin-top: 10px;
        padding: 8px !important;
        font-size: 0.8em !important;
    }
    
    /* Improved mobile layout for buttons */
    .product-action {
        justify-content: flex-end !important;
    }
    
    .wishlist-button {
        padding: 4px 6px !important;
        font-size: 0.65em !important;
        white-space: nowrap;
        min-width: 70px;
        text-align: center;
    }
    
    /* Better spacing for mobile layout */
    .product-name {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    
    .product-price {
        font-size: 0.9em;
    }
    
    /* Compact layout for mobile */
    .wishlist-form {
        box-shadow: none;
        margin-bottom: 0;
    }
    
    /* Adjust remove button for mobile */
    .product-remove {
        padding: 8px !important;
    }
}

/* Mobile landscape specific adjustments */
@media (max-width: 576px) {
    .wishlist-button,
    .wishlist-note-button,
    .wishlist-shop-button {
        font-size: 0.65em !important;
        padding: 4px 6px !important;
    }
    
    .product-thumbnail img {
        width: 45px;
    }
    
    .product-name a {
        font-size: 0.9em;
    }
    
    .product-name small {
        font-size: 0.75em;
    }
}

/**
 * Custom CSS to hide wishlist creation UI
 */

/* Hide all wishlist creation and management UI */
.fw-popup-footer,
.fw-button--new-wishlist,
form[data-fw-form="create-wishlist"],
.fw-popup-items,
.fw-popup-close,
.fw-popup,
.fw-popup-content,
tr[data-fw-wishlist-id],
.woocommerce-wishlist table thead {
    display: none !important;
}

/* Hide the wishlist management page entirely */
body.woocommerce-page-flexible-wishlist-archive .woocommerce-cart-form {
    display: none !important;
}

/* Hide wishlist selection in product page */
.flexible-wishlist-selection,
.flexible-wishlist-dropdown,
.flexible-wishlist-create {
    display: none !important;
}

/* Add a little more space to popup content since we're hiding the form */
.fw-popup-content {
    padding-bottom: 20px;
}

/* Show the note for later form */
.woocommerce-cart-form .actions .coupon {
    display: block !important;
} 