/* ==========================================
   Shop Page - Modern E-Commerce Design
   ========================================== */

/* Page Container */
.shop-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ==========================================
   Shop Header
   ========================================== */
.shop-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.shop-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.shop-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.shop-title-section {
    color: white;
}

.shop-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.shop-title i {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shop-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.shop-subtitle .product-count {
    font-weight: 700;
    color: #fbbf24;
}

/* Shop Controls */
.shop-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.sort-control,
.availability-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sort-control label,
.availability-control label {
    color: white;
    font-size: 1rem;
}

.sort-control .form-select,
.availability-control .form-select {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 2rem 0.25rem 0.5rem;
    min-width: 140px;
    cursor: pointer;
}

.sort-control .form-select option,
.availability-control .form-select option {
    background: #1e1b4b;
    color: white;
}

.sort-control .form-select:focus,
.availability-control .form-select:focus {
    box-shadow: none;
    outline: none;
}

/* ==========================================
   Category Tabs
   ========================================== */
.category-tabs-container {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-tabs-wrapper {
    overflow: hidden;
}

.category-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    scroll-snap-align: start;
}

.category-tab:hover {
    background: #e0e7ff;
    color: #4338ca;
    transform: translateY(-2px);
}

.category-tab.active {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.4);
}

.category-tab i {
    font-size: 1rem;
}

.category-tab-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 6px;
}

/* ==========================================
   Products Grid
   ========================================== */
.shop-products-section {
    padding: 2rem 0 4rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* ==========================================
   Product Card
   ========================================== */
.shop-product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    border: 1px solid #e2e8f0;
}

.shop-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: #c7d2fe;
}

.shop-product-card.out-of-stock {
    opacity: 0.85;
}

/* Product Image */
.shop-product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.shop-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-product-card:hover .shop-product-image img {
    transform: scale(1.08);
}

/* Product Badges */
.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

[dir="rtl"] .product-badge {
    left: auto;
    right: 0.75rem;
}

.product-badge.trending {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
}

.product-badge.new {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.discount-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    z-index: 5;
}

[dir="rtl"] .discount-badge {
    right: auto;
    left: 0.75rem;
}

/* Out of Stock Overlay */
.out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.out-of-stock-overlay span {
    background: rgba(255, 255, 255, 0.95);
    color: #dc2626;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Quick Actions */
.product-quick-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 15;
}

[dir="rtl"] .product-quick-actions {
    right: auto;
    left: 0.75rem;
    transform: translateX(-10px);
}

.shop-product-card:hover .product-quick-actions {
    opacity: 1;
    transform: translateX(0);
}

.quick-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #64748b;
    text-decoration: none;
}

.quick-action-btn:hover {
    background: #4338ca;
    color: white;
    transform: scale(1.1);
}

.quick-action-btn.wishlist-btn.active {
    background: #ef4444;
    color: white;
}

.quick-action-btn.wishlist-btn.active:hover {
    background: #dc2626;
}

/* Product Info */
.shop-product-info {
    padding: 1rem 1.25rem 1.25rem;
}

.product-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
    background: #e0e7ff;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shop-product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

/* Price */
.shop-product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.price-from {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.old-price {
    font-size: 0.875rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.current-price {
    font-size: 1.125rem;
    font-weight: 800;
    color: #4338ca;
}

.out-of-stock-text {
    font-size: 0.875rem;
    color: #dc2626;
    font-weight: 600;
}

/* Product Actions */
.shop-product-actions {
    margin-top: auto;
}

.btn-shop-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
}

.btn-add-cart {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.3);
    min-width: 120px;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 56, 202, 0.4);
}

.btn-add-cart:active {
    transform: scale(0.98);
}

.btn-add-cart.in-cart {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    min-width: 120px;
}

.btn-add-cart.in-cart:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Animation when adding to cart */
.btn-add-cart.adding {
    animation: addToCartPulse 0.4s ease;
}

@keyframes addToCartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Loading state */
.btn-add-cart.loading {
    opacity: 0.8;
    pointer-events: none;
}

.btn-add-cart.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-view-options {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-view-options:hover {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.btn-notify {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #fecaca;
    cursor: not-allowed;
}

/* ==========================================
   Load More Button
   ========================================== */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.btn-load-more {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: white;
    color: #4338ca;
    border: 2px solid #c7d2fe;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    background: #4338ca;
    color: white;
    border-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 56, 202, 0.3);
}

.btn-load-more.loading {
    pointer-events: none;
    opacity: 0.7;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================
   Empty State
   ========================================== */
.shop-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.shop-empty-state .empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-empty-state .empty-icon i {
    font-size: 3rem;
    color: #4338ca;
}

.shop-empty-state h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.shop-empty-state p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.btn-browse-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-browse-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 56, 202, 0.4);
    color: white;
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 992px) {
    .shop-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .shop-controls {
        width: 100%;
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .shop-header {
        padding: 1.5rem 0;
    }
    
    .shop-title {
        font-size: 1.5rem;
    }
    
    .shop-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .sort-control,
    .availability-control {
        width: 100%;
        justify-content: center;
    }
    
    .category-tabs {
        padding: 0.75rem 0;
    }
    
    .category-tab {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .shop-product-info {
        padding: 0.75rem 1rem 1rem;
    }
    
    .shop-product-title {
        font-size: 0.85rem;
        min-height: 2.4em;
    }
    
    .current-price {
        font-size: 1rem;
    }
    
    .btn-shop-action {
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .product-quick-actions {
        opacity: 1;
        transform: translateX(0);
    }
    
    .quick-action-btn {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .shop-title {
        font-size: 1.25rem;
    }
    
    .products-grid {
        gap: 0.5rem;
    }
    
    .shop-product-card {
        border-radius: 12px;
    }
    
    .shop-product-image {
        aspect-ratio: 1;
    }
    
    .shop-product-image img {
        padding: 0.75rem;
    }
    
    .shop-product-info {
        padding: 0.625rem 0.75rem 0.875rem;
    }
    
    .product-category {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
    }
    
    .shop-product-title {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
    
    .shop-product-price {
        margin-bottom: 0.75rem;
    }
    
    .old-price {
        font-size: 0.75rem;
    }
    
    .current-price {
        font-size: 0.9rem;
    }
    
    .btn-shop-action {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
        border-radius: 8px;
        min-width: 44px;
        width: 44px;
        height: 44px;
    }
    
    .btn-shop-action span {
        display: none;
    }
    
    .btn-shop-action i {
        font-size: 1.1rem;
    }
    
    .btn-add-cart,
    .btn-add-cart.in-cart {
        min-width: 44px;
        width: 44px;
    }
    
    .discount-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .product-badge {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ==========================================
   RTL Support
   ========================================== */
[dir="rtl"] .shop-page {
    direction: rtl;
}

[dir="rtl"] .shop-title i {
    margin-left: 0;
    margin-right: 0;
}

[dir="rtl"] .sort-control .form-select,
[dir="rtl"] .availability-control .form-select {
    padding: 0.25rem 0.5rem 0.25rem 2rem;
}

[dir="rtl"] .category-tab {
    flex-direction: row-reverse;
}

[dir="rtl"] .shop-product-price {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-shop-action {
    flex-direction: row-reverse;
}
button.loading i, .btn.loading i, .btn-add-cart-quick.loading i, .discounted-cart-btn.loading i, .best-seller-cart-btn.loading i, .new-arrival-cart-btn.loading i {
      margin-top: 0 !important; 
    margin-left: 0 !important;
}