/**
 * Shop Archive CSS - Modern E-Commerce Design
 * 
 * Features:
 * - Responsive grid layout
 * - Modern card designs with hover effects
 * - Smooth animations & transitions
 * - Gradient effects
 * - Glassmorphism elements
 * - Mobile-first approach
 * - Dark mode ready
 * - Accessibility optimized
 * 
 * @package JazaTH
 * @version 2.0.0
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --jz-primary: #6366f1;
    --jz-primary-dark: #4f46e5;
    --jz-primary-light: #818cf8;
    --jz-secondary: #ec4899;
    --jz-success: #10b981;
    --jz-warning: #f59e0b;
    --jz-danger: #ef4444;
    --jz-dark: #1f2937;
    --jz-light: #f9fafb;
    --jz-gray-50: #f9fafb;
    --jz-gray-100: #f3f4f6;
    --jz-gray-200: #e5e7eb;
    --jz-gray-300: #d1d5db;
    --jz-gray-400: #9ca3af;
    --jz-gray-500: #6b7280;
    --jz-gray-600: #4b5563;
    --jz-gray-700: #374151;
    --jz-gray-800: #1f2937;
    --jz-gray-900: #111827;
    
    --jz-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --jz-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --jz-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --jz-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --jz-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
   
    --jz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --jz-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Base & Container
   ======================================== */
.jz-shop-archive {
    background: var(--jz-light);
    min-height: 100vh;
}

.jz-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   Hero Section
   ======================================== */
.jz-shop-hero {
    position: relative;
    padding: 6rem 0 4rem;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.jz-shop-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.jz-shop-hero__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.9) 0%, 
        rgba(118, 75, 162, 0.9) 100%);
}

.jz-shop-hero__orbs {
    position: absolute;
    inset: 0;
}

.jz-shop-hero__orbs .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.jz-shop-hero__orbs .orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.3);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.jz-shop-hero__orbs .orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.3);
    bottom: -50px;
    right: 10%;
    animation-delay: 5s;
}

.jz-shop-hero__orbs .orb-3 {
    width: 250px;
    height: 250px;
    background: rgba(99, 102, 241, 0.3);
    top: 50%;
    right: -50px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(20px, 10px) scale(1.05); }
}

.jz-shop-hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.jz-shop-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.jz-shop-hero__badge svg {
    color: #fbbf24;
}

.jz-shop-hero__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.jz-shop-hero__desc {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.jz-shop-hero__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.jz-shop-hero__stats .stat {
    text-align: center;
}

.jz-shop-hero__stats .stat strong {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.jz-shop-hero__stats .stat span {
    font-size: 0.875rem;
    opacity: 0.9;
}

.jz-shop-hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.jz-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--jz-transition);
    text-align: center;
}

.jz-btn--primary {
    background: white;
    color: var(--jz-primary);
    box-shadow: var(--jz-shadow-lg);
}

.jz-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--jz-shadow-xl);
}

.jz-btn--outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.jz-btn--outline:hover {
    background: white;
    color: var(--jz-primary);
}

/* ========================================
   Features Bar
   ======================================== */
.jz-shop-features {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid var(--jz-gray-200);
}

.jz-shop-features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.feature-item .icon {
    flex-shrink: 0;
    color: var(--jz-primary);
}

.feature-item strong {
    display: block;
    font-weight: 600;
    color: var(--jz-gray-900);
    margin-bottom: 0.25rem;
}

.feature-item span {
    font-size: 0.875rem;
    color: var(--jz-gray-600);
}

/* ========================================
   Categories Section
   ======================================== */
.jz-shop-categories {
    padding: 4rem 0;
    background: var(--jz-gray-50);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--jz-gray-900);
}

.jz-shop-categories__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    background: white;
    border-radius: 1rem;
    text-decoration: none;
    color: var(--jz-gray-900);
    transition: var(--jz-transition);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--jz-shadow-xl);
    border-color: var(--jz-primary);
}

.category-card__icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--jz-primary), var(--jz-primary-light));
    border-radius: 1rem;
    color: white;
    margin-bottom: 1rem;
    transition: var(--jz-transition);
}

.category-card:hover .category-card__icon {
    transform: scale(1.1) rotate(5deg);
}

.category-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-card .count {
    font-size: 0.875rem;
    color: var(--jz-gray-600);
}

/* ========================================
   Products Section
   ======================================== */
.jz-shop-products {
    padding: 4rem 0;
    background: white;
}

/* Toolbar */
.jz-shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--jz-gray-200);
}

.products-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--jz-gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.products-title .count {
    font-size: 1rem;
    font-weight: 400;
    color: var(--jz-gray-500);
}

.jz-shop-toolbar__right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--jz-gray-100);
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.view-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: var(--jz-gray-600);
    cursor: pointer;
    transition: var(--jz-transition-fast);
}

.view-btn:hover {
    color: var(--jz-gray-900);
}

.view-btn.active {
    background: white;
    color: var(--jz-primary);
    box-shadow: var(--jz-shadow-sm);
}

/* Sort Select */
.sort-wrapper {
    position: relative;
}

.sort-select {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    background: white;
    border: 1px solid var(--jz-gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--jz-gray-900);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
    transition: var(--jz-transition-fast);
}

.sort-select:hover {
    border-color: var(--jz-primary);
}

.sort-select:focus {
    outline: none;
    border-color: var(--jz-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Search */
.search-wrapper {
    position: relative;
}

.search-input {
    width: 250px;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: white;
    border: 1px solid var(--jz-gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--jz-gray-900);
    transition: var(--jz-transition-fast);
}

.search-input:hover {
    border-color: var(--jz-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--jz-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--jz-gray-400);
    pointer-events: none;
}

/* ========================================
   Products Grid
   ======================================== */
.jz-shop-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    transition: var(--jz-transition);
    border: 1px solid var(--jz-gray-200);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--jz-shadow-xl);
    border-color: var(--jz-primary-light);
}

/* Product Image */
.product-card__image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--jz-gray-100);
}

.product-card__image .image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--jz-transition);
}

.product-card:hover .product-card__image img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--jz-gray-400);
}

/* Badges */
.badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    box-shadow: var(--jz-shadow);
}

.badge-sale {
    background: var(--jz-danger);
    color: white;
}

.badge-new {
    background: var(--jz-success);
    color: white;
}

.badge-stock {
    background: var(--jz-warning);
    color: white;
}

/* Product Actions */
.product-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--jz-transition);
    z-index: 2;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--jz-gray-700);
    box-shadow: var(--jz-shadow-md);
    transition: var(--jz-transition-fast);
}

.action-btn:hover {
    background: var(--jz-primary);
    color: white;
    transform: scale(1.1);
}

.action-btn.wishlist-btn.active {
    background: var(--jz-danger);
    color: white;
}

.action-btn.wishlist-btn.active svg {
    fill: currentColor;
}

/* Stock Overlay */
.stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
    z-index: 1;
}

/* Product Content */
.product-card__content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--jz-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--jz-gray-900);
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--jz-transition-fast);
}

.product-title a:hover {
    color: var(--jz-primary);
}

/* Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stars {
    display: flex;
    gap: 0.125rem;
}

.star {
    color: var(--jz-gray-300);
}

.star-full {
    color: #fbbf24;
}

.star-half {
    color: #fbbf24;
}

.rating-text {
    font-size: 0.875rem;
    color: var(--jz-gray-600);
}

/* Price */
.product-price {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.price-old {
    font-size: 0.875rem;
    color: var(--jz-gray-500);
    text-decoration: line-through;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--jz-primary);
}

/* Add to Cart Button */
.add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: var(--jz-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--jz-transition);
    margin-top: auto;
}

.add-to-cart-btn:hover {
    background: var(--jz-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--jz-shadow-md);
}

.add-to-cart-btn.disabled {
    background: var(--jz-gray-300);
    color: var(--jz-gray-600);
    cursor: not-allowed;
}

.add-to-cart-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* No Products */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--jz-gray-500);
}

.no-products svg {
    margin: 0 auto 1.5rem;
}

.no-products h3 {
    font-size: 1.5rem;
    color: var(--jz-gray-700);
    margin-bottom: 0.5rem;
}

/* ========================================
   Pagination
   ======================================== */
.jz-shop-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.jz-shop-pagination ul {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.jz-shop-pagination a,
.jz-shop-pagination span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: white;
    border: 1px solid var(--jz-gray-300);
    border-radius: 0.5rem;
    color: var(--jz-gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: var(--jz-transition-fast);
}

.jz-shop-pagination a:hover {
    background: var(--jz-primary);
    color: white;
    border-color: var(--jz-primary);
}

.jz-shop-pagination .current {
    background: var(--jz-primary);
    color: white;
    border-color: var(--jz-primary);
}

/* ========================================
   Newsletter
   ======================================== */
.jz-shop-newsletter {
    background: linear-gradient(135deg, var(--jz-primary) 0%, var(--jz-primary-dark) 100%);
    color: white;
    padding: 4rem 0;
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.newsletter-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.newsletter-content p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1rem;
    transition: var(--jz-transition-fast);
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .jz-shop-hero {
        padding: 4rem 0 3rem;
    }
    
    .jz-shop-hero__title {
        font-size: 2.5rem;
    }
    
    .jz-shop-categories__grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .jz-shop-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .jz-shop-hero {
        padding: 3rem 0 2rem;
    }
    
    .jz-shop-hero__stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .jz-shop-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .jz-shop-toolbar__right {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .jz-shop-features__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .jz-shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .jz-container {
        padding: 0 1rem;
    }
    
    .jz-shop-hero__actions {
        flex-direction: column;
        width: 100%;
    }
    
    .jz-btn {
        width: 100%;
        justify-content: center;
    }
    
    .jz-shop-categories__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .jz-shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .jz-shop-hero,
    .jz-shop-newsletter,
    .product-actions,
    .add-to-cart-btn,
    .jz-shop-toolbar {
        display: none;
    }
    
    .product-card {
        break-inside: avoid;
    }
}
