/* Custom Shop Archive Page Styles */

/* Main Container */
.custom-shop-archive {
    min-height: 100vh;
    background: #ffffff;
}

/* Mobile Filter Toggle - Now positioned in shop controls */
.mobile-filter-toggle {
    display: flex;
    align-items: center;
}

.mobile-filter-toggle button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    min-width: auto;
    width: auto;
    white-space: nowrap;
}

/* Shop Container */
.shop-container {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Left Sidebar - Filters */
.shop-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 120px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.filters-content {
    padding: 1rem;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-search {
    margin-bottom: 0.75rem;
}

.filter-search input {
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
}

.filter-search input:focus {
    border-color: #3b82f6;
    outline: none;
}

.filter-options {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: #ffffff;
}

.year-filter-options {
    max-height: 300px;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-option:hover {
    background-color: #f9fafb;
}

.filter-checkbox {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    accent-color: #3b82f6;
}

.filter-label {
    flex: 1;
    font-size: 0.875rem;
    color: #374151;
}

.filter-count {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

.filter-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Main Content Area */
.shop-main {
    flex: 1;
    min-width: 0;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.shop-title h1 {
    color: #111827;
    margin-bottom: 0.5rem;
}

.shop-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sort-options select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #ffffff;
    font-size: 0.875rem;
    color: #374151;
}

.view-options {
    display: flex;
    gap: 0.25rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    overflow: hidden;
}

.view-btn {
    padding: 0.5rem;
    background: #ffffff;
    border: none;
    color: #6b7280;
    cursor: pointer;
}

.view-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.view-btn.active {
    background: #3b82f6;
    color: #ffffff;
}

/* Products Grid */
.products-container {
    min-height: 400px;
    position: relative;
}

/* Simple Grid System */
.products-grid {
    display: grid !important;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

/* Desktop: 5 columns */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* Tablet: 4 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Mobile: 3 columns */
@media (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem;
    }
}

/* Override any WooCommerce CSS that might interfere */
.woocommerce .products-grid,
.woocommerce-page .products-grid,
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (max-width: 767px) {
    .woocommerce .products-grid,
    .woocommerce-page .products-grid,
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem !important;
    }
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
    .shop-container {
        flex-direction: column;
        gap: 0;
    }
    
    .shop-sidebar {
        width: 80%;
        height: 100vh;
        position: fixed;
        top: 0;
        left: -100%;
        z-index: 50;
        transition: left 0.3s ease;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        overflow-y: auto;
    }
    
    .shop-sidebar.active {
        left: 0;
    }
}

/* Product Items - Completely Clean (No Background, No Shadow, No Borders) */
.product-item {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: none;
}

.product-item:hover {
    transform: none;
}

.product-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Product Image - Fixed Size for Uniform Look */
.product-image {
    position: relative;
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: transparent;
    border: none;
    width: 100%;
    height: 280px; /* Fixed height for all products */
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-link {
    display: block;
    text-decoration: none;
}

.product-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Maintain aspect ratio without cropping */
    display: block;
    background: transparent;
    transition: none;
    padding: 8px; /* Add some padding around the image */
}

.product-item:hover .product-thumbnail {
    transform: none;
}

.product-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

/* Product Actions */
.product-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
}

.product-item:hover .product-actions {
    opacity: 1;
}

.quick-add-btn,
.quick-view-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-add-btn:hover {
    background: #3b82f6;
    color: #ffffff;
}

.quick-view-btn:hover {
    background: #10b981;
    color: #ffffff;
}

/* Product Info */
.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.6em; /* 2 lines × 1.3 line-height */
}

.product-title-link {
    color: #111827;
    text-decoration: none;
}

.product-title-link:hover {
    color: #3b82f6;
}

.product-author,
.product-language,
.product-year {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.author-label {
    color: #9ca3af;
    margin-right: 0.25rem;
}

.author-name {
    font-weight: 500;
    color: #374151;
}

.language-name {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: #f3f4f6;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: #374151;
}

.year-label {
    color: #9ca3af;
    margin-right: 0.25rem;
}

.year-value {
    font-weight: 600;
    color: #3b82f6;
}

.product-price {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #059669;
}

.product-status {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
}

.out-of-stock {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Add to Cart Button */
.product-cart {
    margin-top: 0.75rem;
}

.add-to-cart-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    /* Debug styles - ensure visibility */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

.add-to-cart-btn:hover {
    background: #2563eb;
}

/* Quick Add Button - ensure visibility */
.quick-add-btn {
    /* Debug styles - ensure visibility */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.woocommerce-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.woocommerce-pagination ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.woocommerce-pagination li {
    margin: 0;
}

.woocommerce-pagination a,
.woocommerce-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
}

.woocommerce-pagination a:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.woocommerce-pagination .current {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.woocommerce-pagination .prev,
.woocommerce-pagination .next {
    font-weight: 600;
}

/* No Products */
.no-products {
    text-align: center;
    padding: 3rem 1rem;
}

/* Mobile Filter Overlay */
.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
}

.mobile-filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Simple mobile adjustments */
@media (max-width: 640px) {
    .shop-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .shop-controls {
        width: 100%;
    }
}

/* Simple Loading State */
.products-grid.loading {
    opacity: 0.6;
}

/* No animations - clean and simple */

/* Simple and clean */
