/* PWD Product Grid - Quick View & Compare Styles */
/* Version: 1.0.0 */

/* ===== Quick View Modal ===== */
.pwd-pg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pwd-pg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.pwd-pg-modal-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pwd-pg-modal-in 0.3s ease;
}

@keyframes pwd-pg-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pwd-pg-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    color: #374151;
    line-height: 1;
}

.pwd-pg-modal-close:hover {
    background: #ef4444;
    color: #fff;
}

.pwd-pg-modal-content {
    padding: 30px;
}

/* Loading */
.pwd-pg-qv-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* Quick View Body */
.pwd-pg-qv-body {
    display: flex;
    gap: 30px;
}

/* Gallery */
.pwd-pg-qv-gallery {
    width: 45%;
    min-width: 280px;
}

.pwd-pg-qv-main-image {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f3f4f6;
    aspect-ratio: 1;
}

.pwd-pg-qv-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pwd-pg-qv-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pwd-pg-qv-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.pwd-pg-qv-thumb:hover,
.pwd-pg-qv-thumb.active {
    border-color: #3b82f6;
}

.pwd-pg-qv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info */
.pwd-pg-qv-info {
    flex: 1;
}

.pwd-pg-qv-categories {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 6px;
}

.pwd-pg-qv-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px;
    line-height: 1.3;
}

.pwd-pg-qv-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.pwd-pg-qv-rating .star-rating {
    font-size: 14px;
}

.pwd-pg-qv-price {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 14px;
}

.pwd-pg-qv-price del {
    color: #9ca3af;
    font-size: 18px;
    font-weight: 400;
}

.pwd-pg-qv-price ins {
    text-decoration: none;
    color: #ef4444;
}

.pwd-pg-qv-description {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 14px;
}

.pwd-pg-qv-sku {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.pwd-pg-qv-stock {
    margin-bottom: 14px;
}

.pwd-pg-in-stock {
    color: #10b981;
    font-weight: 600;
    font-size: 13px;
}

.pwd-pg-out-stock {
    color: #ef4444;
    font-weight: 600;
    font-size: 13px;
}

/* Quantity */
.pwd-pg-qv-quantity {
    margin-bottom: 16px;
}

.pwd-pg-qv-quantity label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.pwd-pg-qty-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}

.pwd-pg-qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #f9fafb;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: background 0.2s;
}

.pwd-pg-qty-btn:hover {
    background: #e5e7eb;
}

.pwd-pg-qv-qty-input {
    width: 50px;
    height: 38px;
    text-align: center;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    font-size: 15px;
    font-weight: 600;
    -moz-appearance: textfield;
}

.pwd-pg-qv-qty-input::-webkit-outer-spin-button,
.pwd-pg-qv-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Actions */
.pwd-pg-qv-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.pwd-pg-qv-add-to-cart {
    flex: 1;
    background: #3b82f6;
    color: #fff;
}

.pwd-pg-qv-add-to-cart:hover {
    background: #2563eb;
}

.pwd-pg-qv-add-to-cart.pwd-pg-added {
    background: #10b981;
}

.pwd-pg-qv-view-product {
    padding: 10px 20px;
    color: #374151;
    border: 1px solid #d1d5db;
    background: #fff;
}

.pwd-pg-qv-view-product:hover {
    background: #f3f4f6;
}

/* Meta Actions */
.pwd-pg-qv-meta-actions {
    display: flex;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.pwd-pg-qv-meta-actions button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.pwd-pg-qv-meta-actions button:hover {
    color: #3b82f6;
}

.pwd-pg-qv-meta-actions button.pwd-pg-active {
    color: #ef4444;
}

/* ===== Compare Bar ===== */
.pwd-pg-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f2937;
    color: #fff;
    z-index: 99998;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    animation: pwd-pg-slide-up 0.3s ease;
}

@keyframes pwd-pg-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.pwd-pg-compare-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.pwd-pg-compare-bar-items {
    display: flex;
    gap: 10px;
    flex: 1;
    overflow-x: auto;
}

.pwd-pg-compare-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    min-width: max-content;
}

.pwd-pg-compare-bar-item img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}

.pwd-pg-compare-bar-item span {
    font-size: 13px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pwd-pg-compare-bar-item button {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
}

.pwd-pg-compare-bar-item button:hover {
    color: #ef4444;
}

.pwd-pg-compare-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwd-pg-compare-count {
    background: #3b82f6;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.pwd-pg-compare-view-btn {
    background: #3b82f6;
    color: #fff;
    padding: 8px 20px;
    font-size: 13px;
}

.pwd-pg-compare-view-btn:hover {
    background: #2563eb;
}

.pwd-pg-compare-clear-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px;
}

.pwd-pg-compare-clear-btn:hover {
    color: #ef4444;
}

/* ===== Compare Table ===== */
.pwd-pg-compare-page {
    overflow-x: auto;
}

.pwd-pg-compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.pwd-pg-compare-table th,
.pwd-pg-compare-table td {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    vertical-align: top;
    font-size: 14px;
}

.pwd-pg-compare-table thead th {
    background: #f9fafb;
    text-align: center;
    min-width: 200px;
}

.pwd-pg-compare-product-header {
    position: relative;
    text-align: center;
}

.pwd-pg-compare-product-header a {
    display: block;
    text-decoration: none;
    color: #1f2937;
}

.pwd-pg-compare-product-header img {
    max-width: 140px;
    height: auto;
    border-radius: 6px;
    margin-bottom: 8px;
}

.pwd-pg-compare-product-header h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.pwd-pg-compare-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #ef4444;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pwd-pg-compare-label {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    min-width: 140px;
}

.pwd-pg-compare-empty {
    text-align: center;
    padding: 60px 20px;
}

/* ===== Wishlist Table ===== */
.pwd-pg-wishlist-page {
    overflow-x: auto;
}

.pwd-pg-wishlist-table {
    width: 100%;
    border-collapse: collapse;
}

.pwd-pg-wishlist-table th,
.pwd-pg-wishlist-table td {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
    font-size: 14px;
}

.pwd-pg-wishlist-table thead th {
    background: #f9fafb;
    font-weight: 600;
    text-align: left;
}

.pwd-pg-wl-remove button {
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
}

.pwd-pg-wl-remove button:hover {
    color: #ef4444;
}

.pwd-pg-wl-product a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1f2937;
}

.pwd-pg-wl-product img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.pwd-pg-wishlist-empty {
    text-align: center;
    padding: 60px 20px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .pwd-pg-qv-body {
        flex-direction: column;
    }

    .pwd-pg-qv-gallery {
        width: 100%;
        min-width: 100%;
    }

    .pwd-pg-modal-content {
        padding: 20px;
    }

    .pwd-pg-compare-bar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .pwd-pg-compare-bar-actions {
        justify-content: center;
    }
}
