/**
 * Wishlist & Compare Styles
 * =============================================
 */

/* =============================================
   RESET PAGE-ENTRY CONFLICTS
   ============================================= */

/* Reset font-size from page-entry */
.page-entry .pneus-wishlist-page,
.page-entry .pneus-compare-page {
    font-size: 16px;
}

/* Reset table styles from page.php */
.page-entry .pneus-compare-table,
.page-entry .pneus-compare-table th,
.page-entry .pneus-compare-table td {
    border: none;
    background: initial;
    padding: 18px 24px;
}

.page-entry .pneus-compare-table {
    width: 100%;
    min-width: 100%;
}

.page-entry .pneus-compare-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    width: 160px;
    text-align: left;
    white-space: nowrap;
}

.page-entry .pneus-compare-table td {
    background: #fff;
    text-align: center;
}

.page-entry .pneus-compare-table tr:nth-child(even) {
    background: initial;
}

.page-entry .pneus-compare-table th,
.page-entry .pneus-compare-table td {
    border-bottom: 1px solid #e5e7eb;
}

.page-entry .pneus-wishlist-item-title a,
.page-entry .pneus-compare-name {
    text-decoration: none;
}

.page-entry .pneus-wishlist-item-title a:hover,
.page-entry .pneus-compare-name:hover {
    text-decoration: none;
}

.page-entry .pneus-btn,
.page-entry .pneus-wishlist-btn-cart,
.page-entry .pneus-wishlist-btn-view {
    text-decoration: none;
}

.page-entry .pneus-btn:hover,
.page-entry .pneus-wishlist-btn-cart:hover,
.page-entry .pneus-wishlist-btn-view:hover {
    text-decoration: none;
}

@media (max-width: 768px) {
    .page-entry .pneus-wishlist-page,
    .page-entry .pneus-compare-page {
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* =============================================
   ACTIVE STATES FOR BUTTONS
   ============================================= */

.pneus-action-btn--wishlist.active,
.pneus-action-btn--compare.active,
.pneus-action-wishlist.active,
.pneus-action-compare.active {
    background-color: var(--theme-primary, #e63946) !important;
    color: #fff !important;
    border-color: var(--theme-primary, #e63946) !important;
}

.pneus-action-btn--wishlist.active svg,
.pneus-action-wishlist.active svg {
    fill: currentColor;
}

.pneus-action-btn--wishlist.active .icon-heart::before {
    content: "\e909";
}

.pneus-action-btn--wishlist.active:hover,
.pneus-action-btn--compare.active:hover,
.pneus-action-wishlist.active:hover,
.pneus-action-compare.active:hover {
    background-color: var(--theme-primary-dark, #c1121f) !important;
}

/* =============================================
   NOTIFICATIONS
   ============================================= */

.pneus-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 320px;
}

.pneus-notification.show {
    transform: translateX(0);
}

.pneus-notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pneus-notification--success .pneus-notification-icon { color: #22c55e; }
.pneus-notification--warning .pneus-notification-icon { color: #f59e0b; }
.pneus-notification--info .pneus-notification-icon { color: #3b82f6; }
.pneus-notification--error .pneus-notification-icon { color: #ef4444; }

.pneus-notification-message {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

/* =============================================
   LOADING STATE
   ============================================= */

.pneus-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: #6b7280;
}

.pneus-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--theme-primary, #e63946);
    border-radius: 50%;
    animation: pneus-spin 0.8s linear infinite;
}

@keyframes pneus-spin {
    to { transform: rotate(360deg); }
}

/* =============================================
   WISHLIST PAGE
   ============================================= */

.pneus-wishlist-page,
.pneus-compare-page {
    padding: 20px 0;
}

.pneus-wishlist-header,
.pneus-compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.pneus-wishlist-title,
.pneus-compare-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.pneus-wishlist-title svg,
.pneus-compare-title svg {
    color: var(--theme-primary, #e63946);
}

.pneus-wishlist-header-actions,
.pneus-compare-header-actions {
    display: flex;
    gap: 12px;
}

/* =============================================
   WISHLIST GRID
   ============================================= */

.pneus-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1199px) {
    .pneus-wishlist-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 991px) {
    .pneus-wishlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 575px) {
    .pneus-wishlist-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* =============================================
   WISHLIST ITEM CARD
   ============================================= */

.pneus-wishlist-item {
    position: relative;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pneus-wishlist-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

/* Remove button */
.pneus-wishlist-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
}

.pneus-wishlist-item:hover .pneus-wishlist-remove {
    opacity: 1;
}

.pneus-wishlist-remove:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* Image */
.pneus-wishlist-item-image {
    display: block;
    aspect-ratio: 1;
    padding: 20px;
    background: #f9fafb;
    overflow: hidden;
}

.pneus-wishlist-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.pneus-wishlist-item:hover .pneus-wishlist-item-image img {
    transform: scale(1.05);
}

/* Info section */
.pneus-wishlist-item-info {
    padding: 16px;
}

.pneus-wishlist-item-brand {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-primary, #e63946);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.pneus-wishlist-item-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.pneus-wishlist-item-title a {
    color: #1f2937;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pneus-wishlist-item-title a:hover {
    color: var(--theme-primary, #e63946);
}

.pneus-wishlist-item-spec {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 10px;
}

.pneus-wishlist-item-price {
    margin-bottom: 10px;
}

.pneus-wishlist-item-price .price-old {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-right: 8px;
}

.pneus-wishlist-item-price .price-current {
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-primary, #e63946);
}

.pneus-wishlist-item-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.pneus-wishlist-item-stock.in-stock {
    color: #16a34a;
}

.pneus-wishlist-item-stock.out-of-stock {
    color: #dc2626;
}

.pneus-wishlist-item-actions {
    margin-top: auto;
}

.pneus-wishlist-btn-cart,
.pneus-wishlist-btn-view {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.pneus-wishlist-btn-cart {
    background: var(--theme-primary, #e63946);
    color: #fff;
    border: none;
}

.pneus-wishlist-btn-cart:hover {
    background: var(--theme-primary-dark, #c1121f);
    color: #fff;
}

.pneus-wishlist-btn-view {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.pneus-wishlist-btn-view:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* =============================================
   COMPARE PAGE / TABLE
   ============================================= */

.pneus-compare-table-wrapper {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.pneus-compare-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pneus-compare-table th,
.pneus-compare-table td {
    padding: 18px 24px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
}

.pneus-compare-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    text-align: left;
    width: 160px;
    white-space: nowrap;
}

.pneus-compare-table td {
    background: #fff;
}

.pneus-compare-table tr:last-child th,
.pneus-compare-table tr:last-child td {
    border-bottom: none;
}

.pneus-compare-table tr:hover td {
    background: #f9fafb;
}

/* Compare row styles */
.pneus-compare-row--remove td {
    padding: 12px 20px;
}

.pneus-compare-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pneus-compare-remove:hover {
    background: #fef2f2;
    color: #ef4444;
}

.pneus-compare-image {
    display: block;
}

.pneus-compare-image img {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
}

.pneus-compare-name {
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pneus-compare-name:hover {
    color: var(--theme-primary, #e63946);
}

.pneus-compare-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-primary, #e63946);
}

.pneus-compare-price del {
    font-size: 14px;
    font-weight: 400;
    color: #9ca3af;
}

.pneus-compare-price ins {
    text-decoration: none;
}

.pneus-compare-na {
    color: #9ca3af;
    font-style: italic;
}

.pneus-compare-yes {
    color: #22c55e;
    font-weight: 500;
}

.pneus-compare-no {
    color: #9ca3af;
}

.pneus-compare-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.pneus-compare-stock--in {
    background: #dcfce7;
    color: #166534;
}

.pneus-compare-stock--out {
    background: #fef2f2;
    color: #991b1b;
}

.pneus-compare-row--action td {
    padding: 20px;
}

.pneus-compare-row--action .pneus-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =============================================
   EMPTY STATES
   ============================================= */

.pneus-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    max-width: 400px;
    margin: 0 auto;
}

.pneus-empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
    margin-bottom: 24px;
    color: #9ca3af;
}

.pneus-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px;
}

.pneus-empty-state p {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.6;
}

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

.pneus-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pneus-btn--primary {
    background: var(--theme-primary, #e63946);
    color: #fff;
    border-color: var(--theme-primary, #e63946);
}

.pneus-btn--primary:hover {
    background: var(--theme-primary-dark, #c1121f);
    border-color: var(--theme-primary-dark, #c1121f);
    color: #fff;
}

.pneus-btn--secondary {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.pneus-btn--secondary:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.pneus-btn--outline {
    background: transparent;
    color: #6b7280;
    border-color: #d1d5db;
}

.pneus-btn--outline:hover {
    background: #f3f4f6;
    color: #374151;
}

/* =============================================
   HEADER COUNT BADGES
   ============================================= */

.header-wishlist-count,
.header-compare-count,
.wishlist-count,
.compare-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: var(--theme-primary, #e63946);
    border-radius: 10px;
    display: none;
}

.header-wishlist-count.has-items,
.header-compare-count.has-items,
.wishlist-count.has-items,
.compare-count.has-items {
    display: block;
}

/* =============================================
   ERROR STATE
   ============================================= */

.pneus-error {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
    font-size: 15px;
}

/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */

@media (max-width: 767px) {
    .pneus-wishlist-header,
    .pneus-compare-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pneus-wishlist-title,
    .pneus-compare-title {
        font-size: 20px;
    }

    .pneus-compare-table th {
        width: 120px;
        min-width: 120px;
        padding: 12px 16px;
        font-size: 13px;
    }

    .pneus-compare-table td {
        padding: 12px 16px;
        min-width: 180px;
    }

    .pneus-compare-image img {
        max-width: 100px;
    }

    .pneus-notification {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: none;
    }

    .pneus-wishlist-remove {
        opacity: 1;
    }
}
