/**
 * Product Archive Widget Styles
 * 
 * Professional styling for product archive widget
 */

.psm-product-archive {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Archive Controls */
.psm-archive-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

/* Search Box */
.psm-search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    min-width: 250px;
}

.psm-search-box:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.psm-search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.psm-search-btn {
    padding: 12px 15px;
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.psm-search-btn:hover {
    background: #005a87;
}

.psm-search-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Filters */
.psm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    flex: 1;
}

.psm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.psm-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.psm-filter-select,
.psm-sort-select {
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.psm-filter-select:focus,
.psm-sort-select:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Sort Box */
.psm-sort-box {
    min-width: 180px;
}

/* Products Container */
.psm-products-container {
    position: relative;
    transition: opacity 0.3s ease;
}

.psm-products-container.psm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.psm-products-container.psm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Product Cards */
.psm-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
}

/* Card Styles */
.psm-card-modern {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.psm-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.psm-card-classic {
    border: 2px solid #e9ecef;
    box-shadow: none;
}

.psm-card-classic:hover {
    border-color: #007cba;
}

.psm-card-minimal {
    border: none;
    box-shadow: none;
    background: transparent;
}

.psm-card-minimal .psm-card-content {
    padding: 15px 0;
}

.psm-card-luxury {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 1px solid #d4af37;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.1);
}

.psm-card-luxury:hover {
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.2);
}

/* Card Image */
.psm-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #f8f9fa;
}

.psm-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.psm-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
    font-size: 48px;
}

/* Hover Effects */
.psm-hover-zoom .psm-product-image:hover {
    transform: scale(1.1);
}

.psm-hover-slide .psm-card-overlay {
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.psm-hover-slide .psm-card-image:hover .psm-card-overlay {
    transform: translateY(0);
}

.psm-hover-fade .psm-card-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.psm-hover-fade .psm-card-image:hover .psm-card-overlay {
    opacity: 1;
}

.psm-hover-rotate .psm-product-image:hover {
    transform: rotate(3deg) scale(1.05);
}

/* Card Overlay */
.psm-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 124, 186, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.psm-card-image:hover .psm-card-overlay {
    opacity: 1;
}

.psm-quick-view-btn {
    background: white;
    color: #007cba;
    padding: 12px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psm-quick-view-btn:hover {
    background: #007cba;
    color: white;
    transform: scale(1.1);
}

.psm-quick-view-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Card Content */
.psm-card-content {
    padding: 20px;
}

.psm-card-categories {
    margin-bottom: 10px;
}

.psm-category-tag {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 5px;
}

.psm-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.psm-card-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.3s ease;
}

.psm-card-title a:hover {
    color: #007cba;
}

.psm-card-excerpt {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Card Meta */
.psm-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* Pagination */
.psm-pagination {
    text-align: center;
    margin-top: 40px;
}

.psm-load-more {
    background: #007cba;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.psm-load-more:hover {
    background: #005a87;
    transform: translateY(-2px);
}

.psm-load-more.loading {
    opacity: 0.7;
    pointer-events: none;
}

.psm-load-more.loading .dashicons {
    animation: spin 1s linear infinite;
}

/* No Products */
.psm-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.psm-no-products h3 {
    margin: 0 0 10px;
    color: #495057;
}

/* Animations */
.psm-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.psm-animate.psm-animated {
    opacity: 1;
    transform: translateY(0);
}

.psm-slideInUp {
    transform: translateY(50px);
}

.psm-slideInLeft {
    transform: translateX(-50px);
}

.psm-zoomIn {
    transform: scale(0.8);
}

.psm-bounceIn {
    transform: scale(0.3);
}

.psm-fadeIn.psm-animated {
    animation: fadeIn 0.6s ease forwards;
}

.psm-slideInUp.psm-animated {
    animation: slideInUp 0.6s ease forwards;
}

.psm-slideInLeft.psm-animated {
    animation: slideInLeft 0.6s ease forwards;
}

.psm-zoomIn.psm-animated {
    animation: zoomIn 0.6s ease forwards;
}

.psm-bounceIn.psm-animated {
    animation: bounceIn 0.8s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: scale3d(.3, .3, .3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(.9, .9, .9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(.97, .97, .97);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

/* Layout Variations */
.psm-layout-masonry .psm-products-container {
    column-count: var(--psm-columns);
    column-gap: var(--psm-gap);
}

.psm-layout-masonry .psm-product-card {
    break-inside: avoid;
    margin-bottom: var(--psm-gap);
}

.psm-layout-list .psm-products-container {
    display: block;
}

.psm-layout-list .psm-product-card {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
}

.psm-layout-list .psm-card-image {
    width: 200px;
    flex-shrink: 0;
    margin-right: 20px;
}

.psm-layout-list .psm-card-content {
    flex: 1;
}

.psm-layout-carousel .psm-products-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--psm-gap);
    padding-bottom: 10px;
}

.psm-layout-carousel .psm-product-card {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

/* Responsive Design */
@media (max-width: 992px) {
    .psm-archive-controls {
        flex-direction: column;
    }
    
    .psm-filters {
        justify-content: center;
    }
    
    .psm-search-box {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .psm-card-content {
        padding: 15px;
    }
    
    .psm-card-title {
        font-size: 16px;
    }
    
    .psm-layout-list .psm-product-card {
        flex-direction: column;
    }
    
    .psm-layout-list .psm-card-image {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .psm-archive-controls {
        padding: 15px;
    }
    
    .psm-filters {
        gap: 10px;
    }
    
    .psm-filter-group {
        min-width: 120px;
    }
    
    .psm-card-content {
        padding: 12px;
    }
    
    .psm-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Quick View Modal */
.psm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.psm-modal.active {
    display: block;
}

.psm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.psm-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.psm-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psm-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.psm-modal-close .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.psm-modal-body {
    padding: 40px;
    min-height: 300px;
}

.psm-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.psm-loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.psm-loading-spinner p {
    color: #6c757d;
    margin: 0;
}

/* Error Message */
.psm-error-message {
    text-align: center;
    padding: 40px 20px;
    color: #721c24;
    background: #f8d7da;
    border-radius: 8px;
    margin: 20px 0;
}

.psm-error-message .button {
    margin-top: 15px;
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

/* Results Counter */
.psm-results-counter {
    margin-left: auto;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
}

/* Carousel Navigation */
.psm-carousel-wrapper {
    position: relative;
}

.psm-carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
}

.psm-carousel-prev,
.psm-carousel-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e9ecef;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.psm-carousel-prev {
    left: -25px;
}

.psm-carousel-next {
    right: -25px;
}

.psm-carousel-prev:hover,
.psm-carousel-next:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
    transform: scale(1.1);
}

.psm-carousel-prev .dashicons,
.psm-carousel-next .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}