/**
 * Tomes & Tokens Custom Wishlist Styles
 * Reuses theme design tokens and cart components for complete consistency.
 */

/* ==========================================================================
   1. Catalog Loop Card Wishlist Button (Recuperated & Centered)
   ========================================================================== */
.tomes-wishlist-loop-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 10px auto 0 auto;
    padding: 0;
}

.tomes-wishlist-toggle.tomes-wishlist-loop-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 2px 8px;
    margin: 0 auto;
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.tomes-wishlist-toggle.tomes-wishlist-loop-btn .tomes-wishlist-text {
    display: block;
    width: 100%;
    max-width: 75px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.2;
}

.tomes-wishlist-toggle.tomes-wishlist-loop-btn:hover {
    color: var(--tomes-gold, #d4a359);
    transform: translateY(-1px);
    background: transparent;
}

.tomes-wishlist-toggle.tomes-wishlist-loop-btn.is-active {
    color: var(--tomes-gold, #d4a359);
}

.tomes-wishlist-toggle.tomes-wishlist-loop-btn .tomes-wishlist-heart {
    display: block;
    margin: 0 auto;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

.tomes-wishlist-toggle.tomes-wishlist-loop-btn:hover .tomes-wishlist-heart {
    transform: scale(1.15);
}

/* ==========================================================================
   2. Single Product Page Wishlist Button
   ========================================================================== */
.tomes-wishlist-single-wrapper {
    display: inline-block;
    margin-left: 12px;
    vertical-align: middle;
}

.tomes-wishlist-toggle.tomes-wishlist-single-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 22px;
    height: 48px;
    border-radius: var(--tomes-radius-pill, 9999px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: var(--tomes-transition, all 0.25s ease);
}

.tomes-wishlist-toggle.tomes-wishlist-single-btn:hover {
    color: var(--tomes-gold, #d4a359);
    border-color: rgba(212, 163, 89, 0.45);
    background: rgba(212, 163, 89, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.tomes-wishlist-toggle.tomes-wishlist-single-btn.is-active {
    color: var(--tomes-gold, #d4a359);
    border-color: rgba(212, 163, 89, 0.5);
    background: rgba(212, 163, 89, 0.12);
}

/* ==========================================================================
   3. Wishlist Table: Red Cancellation Button (Identical to Cart Page)
   ========================================================================== */
table.tomes-wishlist-table td.product-remove {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 16px 8px !important;
    background: transparent !important;
}

table.tomes-wishlist-table td.product-remove a.remove,
table.tomes-wishlist-table td.product-remove a.tomes-wishlist-remove {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    border-radius: 50% !important;
    background: rgba(239, 68, 68, 0.12) !important;
    background-color: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    padding: 0 !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: var(--tomes-transition, all 0.25s ease) !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
    vertical-align: middle !important;
}

table.tomes-wishlist-table td.product-remove a.remove:hover,
table.tomes-wishlist-table td.product-remove a.tomes-wishlist-remove:hover {
    background: #ef4444 !important;
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

table.tomes-wishlist-table td.product-remove a.tomes-wishlist-remove svg.tomes-remove-icon {
    display: block !important;
    width: 10px !important;
    height: 10px !important;
    margin: 0 auto !important;
    stroke: currentColor !important;
    stroke-width: 2.2px !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    pointer-events: none !important;
}

/* ==========================================================================
   4. Wishlist Container Card & Table (Matches Cart Page Single Dark Card)
   ========================================================================== */
.tomes-wishlist-container {
    background: var(--tomes-bg-card, #1e2433) !important;
    border: 1px solid rgba(212, 163, 89, 0.2) !important;
    border-radius: 18px !important;
    padding: 24px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 1280px !important;
    margin: 0 auto !important;
}

/* Inside My Account dashboard: strip intermediate card container so table sits directly in content card */
.woocommerce-MyAccount-content .tomes-wishlist-container {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

table.tomes-wishlist-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.woocommerce-MyAccount-content table.tomes-wishlist-table {
    margin: 16px 0 0 0 !important;
}

table.tomes-wishlist-table thead {
    background: transparent !important;
    border: none !important;
}

table.tomes-wishlist-table thead tr {
    background: transparent !important;
    border: none !important;
}

/* Header Cells: Subtle text box matching cart header */
table.tomes-wishlist-table thead th {
    background: rgba(255, 255, 255, 0.04) !important;
    color: #cbd5e1 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 14px 12px !important;
    border: none !important;
    border-bottom: 1px solid rgba(212, 163, 89, 0.25) !important;
    vertical-align: middle !important;
}

/* Left columns have transparent header so card background shows through seamlessly */
table.tomes-wishlist-table thead th.product-remove,
table.tomes-wishlist-table thead th.product-thumbnail {
    background: transparent !important;
    border-bottom: 1px solid rgba(212, 163, 89, 0.25) !important;
}

table.tomes-wishlist-table thead th.product-name {
    border-top-left-radius: 6px !important;
    border-bottom-left-radius: 6px !important;
    padding-left: 14px !important;
}

table.tomes-wishlist-table thead th.product-action {
    border-top-right-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
    text-align: center !important;
}

/* Table Body Rows */
table.tomes-wishlist-table tbody tr {
    background: transparent !important;
}

table.tomes-wishlist-table td {
    color: #ffffff !important;
    padding: 16px 12px !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    vertical-align: middle !important;
    background: transparent !important;
}

table.tomes-wishlist-table td.product-thumbnail {
    width: 80px !important;
    padding: 16px 8px !important;
}

table.tomes-wishlist-table td.product-thumbnail img {
    width: 64px !important;
    height: 64px !important;
    object-fit: contain !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    padding: 4px !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

table.tomes-wishlist-table td.product-name a {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    font-size: 14.5px !important;
    line-height: 1.4 !important;
    transition: color 0.2s ease !important;
}

table.tomes-wishlist-table td.product-name a:hover {
    color: var(--tomes-gold, #d4a359) !important;
}

table.tomes-wishlist-table td.product-price {
    color: var(--tomes-gold, #d4a359) !important;
    font-weight: 700 !important;
    font-size: 14.5px !important;
}

.tomes-in-stock {
    color: #10b981;
    font-weight: 600;
    font-size: 13.5px;
}

.tomes-out-of-stock {
    color: #ef4444;
    font-weight: 600;
    font-size: 13.5px;
}

/* Action column & Add to Cart button */
table.tomes-wishlist-table th.product-action,
table.tomes-wishlist-table td.product-action {
    width: 170px !important;
    min-width: 170px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

table.tomes-wishlist-table td.product-action a.button,
table.tomes-wishlist-table td.product-action .tomes-wishlist-add-to-cart {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    line-height: 1 !important;
    padding: 0 20px !important;
    white-space: nowrap !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    border-radius: var(--tomes-radius-pill, 9999px) !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: var(--tomes-transition, all 0.25s ease) !important;
}

table.tomes-wishlist-table td.product-action a.button span,
table.tomes-wishlist-table td.product-action .tomes-wishlist-add-to-cart span {
    display: inline-block !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Footer Actions: Seamless card background (no 3rd color) */
table.tomes-wishlist-table tfoot {
    background: transparent !important;
    border: none !important;
}

table.tomes-wishlist-table tfoot td.actions {
    background: transparent !important;
    background-color: transparent !important;
    padding: 24px 0 0 0 !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.tomes-wishlist-footer-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

.button.tomes-btn-gold {
    background: var(--tomes-gold, #d4a359) !important;
    color: #0c2340 !important;
    border: none !important;
    border-radius: var(--tomes-radius-pill, 9999px) !important;
    height: 42px !important;
    line-height: 1 !important;
    padding: 0 26px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: var(--tomes-transition, all 0.25s ease) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

.button.tomes-btn-gold:hover {
    background: var(--tomes-gold-hover, #f3c27a) !important;
    color: #0c2340 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(212, 163, 89, 0.45) !important;
}

.button.tomes-btn-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    border: 1px solid rgba(212, 163, 89, 0.35) !important;
    border-radius: var(--tomes-radius-pill, 9999px) !important;
    height: 42px !important;
    line-height: 1 !important;
    padding: 0 24px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: var(--tomes-transition, all 0.25s ease) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

.button.tomes-btn-secondary:hover {
    border-color: var(--tomes-gold, #d4a359) !important;
    background: rgba(212, 163, 89, 0.12) !important;
    color: var(--tomes-gold, #d4a359) !important;
    transform: translateY(-2px) !important;
}

/* ==========================================================================
   5. Empty State Card
   ========================================================================== */
.tomes-wishlist-empty-card {
    background: var(--tomes-bg-card, #1e2433);
    border: 1px solid rgba(212, 163, 89, 0.22);
    border-radius: 18px;
    padding: 48px 32px;
    text-align: center;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.tomes-wishlist-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(212, 163, 89, 0.1);
    color: var(--tomes-gold, #d4a359);
    margin-bottom: 20px;
}

.tomes-wishlist-empty-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 12px 0;
}

.tomes-wishlist-empty-message {
    color: #94a3b8;
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0 0 28px 0;
}

/* ==========================================================================
   6. Minimal Toast Notification
   ========================================================================== */
.tomes-wishlist-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #0f1c34;
    border: 1px solid var(--tomes-gold, #d4a359);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 9999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 999999;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.tomes-wishlist-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tomes-wishlist-toast.is-error {
    border-color: #ef4444;
    color: #fca5a5;
}
