/* ============================================================================
   NexMock Products - Frontend Styles
   ============================================================================ */

:root {
    --nexmock-primary: #2c3e50;
    --nexmock-secondary: #3498db;
    --nexmock-accent: #e74c3c;
    --nexmock-light: #ecf0f1;
    --nexmock-lighter: #f8f9fa;
    --nexmock-dark: #1a252f;
    --nexmock-border: #bdc3c7;
    --nexmock-success: #27ae60;
    --nexmock-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --nexmock-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --nexmock-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nexmock-radius: 8px;
}

/* ============================================================================
   Products Wrapper
   ============================================================================ */

.nexmock-products-wrapper {
    position: relative;
    margin-bottom: 40px;
}

.nexmock-products {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(4, 1fr);
}

.nexmock-products.grid-col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.nexmock-products.grid-col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.nexmock-products.grid-col-4 {
    grid-template-columns: repeat(4, 1fr);
}

.nexmock-products.grid-col-5 {
    grid-template-columns: repeat(5, 1fr);
}

.nexmock-products.grid-col-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* ============================================================================
   Product Item
   ============================================================================ */

.nexmock-product-item {
    position: relative;
    height: 100%;
    list-style: none;
}

/* Animation - Fade In */
.nexmock-products[data-animation="fade-in"] .nexmock-product-item {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation - Slide Up */
.nexmock-products[data-animation="slide-up"] .nexmock-product-item {
    animation: slideUp 0.4s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation - Scale */
.nexmock-products[data-animation="scale"] .nexmock-product-item {
    animation: scaleIn 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stagger animation delays */
.nexmock-product-item:nth-child(1) { animation-delay: 0s; }
.nexmock-product-item:nth-child(2) { animation-delay: 0.1s; }
.nexmock-product-item:nth-child(3) { animation-delay: 0.2s; }
.nexmock-product-item:nth-child(4) { animation-delay: 0.3s; }
.nexmock-product-item:nth-child(n+5) { animation-delay: 0.4s; }

/* ============================================================================
   Product Card - Modern Style
   ============================================================================ */

.nexmock-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: var(--nexmock-radius);
    overflow: hidden;
    transition: var(--nexmock-transition);
    box-shadow: var(--nexmock-shadow);
    border: 1px solid #f0f0f0;
}

.nexmock-product-card:hover {
    box-shadow: var(--nexmock-shadow-lg);
    transform: translateY(-4px);
}

/* Modern Card Style */
.nexmock-products.card-style-modern .nexmock-product-card {
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
}

/* Minimal Card Style */
.nexmock-products.card-style-minimal .nexmock-product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: none;
}

.nexmock-products.card-style-minimal .nexmock-product-card:hover {
    border-color: var(--nexmock-secondary);
    box-shadow: var(--nexmock-shadow);
}

/* Classic Card Style */
.nexmock-products.card-style-classic .nexmock-product-card {
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 0;
}

/* Overlay Card Style */
.nexmock-products.card-style-overlay .nexmock-product-card {
    position: relative;
}

.nexmock-products.card-style-overlay .nexmock-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: var(--nexmock-transition);
    z-index: 1;
}

.nexmock-products.card-style-overlay .nexmock-product-card:hover::before {
    background: rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   Product Image Section
   ============================================================================ */

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--nexmock-lighter);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nexmock-product-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nexmock-product-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    transition: var(--nexmock-transition);
}

.nexmock-product-item:hover .nexmock-product-image {
    transform: scale(1.05);
}

/* Lazy load placeholder */
.nexmock-product-image[data-src] {
    opacity: 0;
}

.nexmock-product-image.loaded {
    opacity: 1;
}

/* Stock Badge */
.stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stock-badge.in-stock {
    background: var(--nexmock-success);
    color: #fff;
}

.stock-badge.out-of-stock {
    background: #95a5a6;
    color: #fff;
}

/* Quick View Button */
.nexmock-quick-view {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    opacity: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--nexmock-secondary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--nexmock-transition);
    border: none;
    z-index: 10;
    font-size: 18px;
}

.nexmock-product-item:hover .nexmock-quick-view {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nexmock-quick-view:hover {
    background: var(--nexmock-primary);
}

/* ============================================================================
   Product Info Section
   ============================================================================ */

.product-info-wrapper {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* Product Title */
.nexmock-product-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--nexmock-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nexmock-product-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--nexmock-transition);
}

.nexmock-product-title a:hover {
    color: var(--nexmock-secondary);
}

/* Product Rating */
.nexmock-product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.nexmock-product-rating .star {
    color: #ffc107;
}

.rating-count {
    color: #999;
}

/* Product Price */
.nexmock-product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--nexmock-secondary);
    margin: 4px 0;
}

.nexmock-product-price .woocommerce-Price-amount {
    color: var(--nexmock-secondary);
}

.nexmock-product-price del {
    opacity: 0.6;
    color: var(--nexmock-border);
    font-weight: 400;
    margin-right: 8px;
}

/* Product Actions */
.product-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.nexmock-add-to-cart {
    display: flex;
    width: 100%;
    margin: 0;
}

.nexmock-add-to-cart button,
.nexmock-add-to-cart a.button {
    flex: 1;
    padding: 10px 16px;
    background: var(--nexmock-secondary);
    color: #fff;
    border: none;
    border-radius: var(--nexmock-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--nexmock-transition);
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nexmock-add-to-cart button:hover,
.nexmock-add-to-cart a.button:hover {
    background: var(--nexmock-primary);
}

/* ============================================================================
   Filters Wrapper
   ============================================================================ */

.nexmock-filters-wrapper {
    margin-bottom: 30px;
    background: #fff;
    border-radius: var(--nexmock-radius);
    overflow: hidden;
}

.nexmock-filters {
    padding: 20px;
    border: 1px solid #f0f0f0;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.filters-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--nexmock-primary);
}

.filters-toggle-mobile {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--nexmock-primary);
}

.filters-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ============================================================================
   Filter Groups
   ============================================================================ */

.filter-group {
    padding: 0;
}

.filter-group h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--nexmock-primary);
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-list li label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--nexmock-transition);
    padding: 4px;
}

.filter-list li label:hover {
    color: var(--nexmock-secondary);
}

.filter-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--nexmock-secondary);
}

.filter-label {
    font-size: 13px;
    color: var(--nexmock-primary);
    flex: 1;
}

.filter-count {
    font-size: 12px;
    color: #999;
}

/* Price Range Slider */
.price-range-slider {
    width: 100%;
    margin-bottom: 12px;
    cursor: pointer;
}

.price-range-display {
    font-size: 13px;
    color: var(--nexmock-primary);
    font-weight: 600;
}

/* Clear Filters Button */
.clear-filters-btn {
    width: 100%;
    padding: 10px;
    background: var(--nexmock-accent);
    color: #fff;
    border: none;
    border-radius: var(--nexmock-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--nexmock-transition);
}

.clear-filters-btn:hover {
    background: #c0392b;
}

/* ============================================================================
   Quick View Modal
   ============================================================================ */

.nexmock-quick-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.quick-view-content {
    position: relative;
    background: #fff;
    border-radius: var(--nexmock-radius);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--nexmock-shadow-lg);
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-view-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    z-index: 10;
    transition: var(--nexmock-transition);
}

.quick-view-close:hover {
    color: var(--nexmock-accent);
}

.quick-view-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
}

.quick-view-image {
    background: var(--nexmock-lighter);
    border-radius: var(--nexmock-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-view-image img {
    max-width: 100%;
    max-height: 400px;
}

.quick-view-info h2 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: var(--nexmock-primary);
}

.quick-view-rating {
    margin-bottom: 12px;
}

.quick-view-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--nexmock-secondary);
    margin-bottom: 16px;
}

.quick-view-description {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 16px;
}

.quick-view-stock {
    margin-bottom: 16px;
}

.quick-view-stock .stock {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.quick-view-stock .in-stock {
    background: var(--nexmock-success);
    color: #fff;
}

.quick-view-stock .out-of-stock {
    background: #95a5a6;
    color: #fff;
}

.quick-view-actions {
    display: flex;
    gap: 12px;
}

.quick-view-actions .button {
    flex: 1;
    padding: 12px;
    border-radius: var(--nexmock-radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--nexmock-transition);
}

.quick-view-actions .button-primary {
    background: var(--nexmock-secondary);
    color: #fff;
}

.quick-view-actions .button-primary:hover {
    background: var(--nexmock-primary);
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 1200px) {
    .nexmock-products.grid-col-5 {
        grid-template-columns: repeat(4, 1fr);
    }

    .nexmock-products.grid-col-6 {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .nexmock-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .nexmock-products.grid-col-3,
    .nexmock-products.grid-col-4,
    .nexmock-products.grid-col-5,
    .nexmock-products.grid-col-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-info-wrapper {
        padding: 12px;
        gap: 8px;
    }

    .nexmock-product-title {
        font-size: 13px;
    }

    .quick-view-body {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .filters-toggle-mobile {
        display: block;
    }

    .filters-content {
        display: none;
    }

    .filters-content.active {
        display: flex;
    }
}

@media (max-width: 480px) {
    .nexmock-products {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .nexmock-products.grid-col-2,
    .nexmock-products.grid-col-3,
    .nexmock-products.grid-col-4,
    .nexmock-products.grid-col-5,
    .nexmock-products.grid-col-6 {
        grid-template-columns: 1fr;
    }

    .nexmock-product-title {
        -webkit-line-clamp: 1;
    }

    .product-actions {
        flex-direction: column;
    }

    .nexmock-add-to-cart {
        width: 100%;
    }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.no-products-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}
