/* ==========================================================================
   All Products Page - Tekno Time
   Premium, minimalist, RTL-first design
   ========================================================================== */

/* Hero Section */
.products-hero {
    position: relative;
    height: 40vh;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.hero-content {
    text-align: center;
    padding: var(--spacing-xl);
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: var(--font-light);
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    letter-spacing: normal;
}

.hero-subtitle {
    font-size: var(--text-lg);
    font-weight: var(--font-light);
    color: var(--color-text-secondary);
}

/* Category Section */
.category-section {
    padding: var(--spacing-3xl) var(--container-padding);
    background: var(--color-bg);
}

.category-section:nth-child(even) {
    background: linear-gradient(180deg, rgba(245, 245, 245, 0.4) 0%, rgba(250, 250, 250, 0.3) 100%);
}

.category-header {
    position: relative;
    max-width: 100%;
    margin: 0 auto var(--spacing-2xl);
    text-align: center;
    height: 40vh;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    overflow: hidden;
}

.category-header-overlay {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    padding: var(--spacing-2xl) var(--spacing-xl);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.category-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.35) 100%
    );
    z-index: 1;
}

.category-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-light);
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
    letter-spacing: normal;
}

.category-title-text {
    display: inline-block;
    padding: 0.5em 1.5em;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 100px;
    font-weight: var(--font-medium);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.category-description {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.category-view-all {
    display: inline-block;
    margin-top: var(--spacing-md);
    font-size: var(--text-sm);
    color: var(--color-text);
    font-weight: var(--font-medium);
    transition: all var(--transition-base);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.category-view-all:hover {
    opacity: 0.7;
    transform: translateX(-4px);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-xl);
    max-width: 1400px;
    margin: 0 auto;
}

/* Product Card */
.product-card-item {
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    cursor: pointer;
    transition: all 600ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.product-card-item:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
}

.product-image-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-bg-light);
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 600ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.product-card-item:hover .product-image-wrapper img {
    transform: scale(1.08);
}

.product-badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.product-info {
    padding: var(--spacing-md);
}

.product-name {
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    color: var(--color-text);
    margin-bottom: 0.25rem;
    letter-spacing: normal;
    line-height: 1.3;
}

.product-model {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.product-features {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: var(--spacing-sm);
}

.feature {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.feature::before {
    content: '•';
    color: var(--color-text);
    font-weight: var(--font-bold);
}

.product-action {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-quick-view {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    background: var(--color-text);
    color: #fff;
    border: 1px solid var(--color-text);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-quick-view:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Coffee Capsules Special Section */
.coffee-capsules-section {
    --color-coffee-brown: #5A3E2B;
    --color-coffee-cream: #F5E6D3;
    --color-coffee-dark: #3D2A1E;
    
    padding: var(--spacing-3xl) var(--container-padding);
    background: linear-gradient(135deg, rgba(245, 245, 245, 0.95) 0%, rgba(250, 250, 250, 0.9) 100%);
}

.coffee-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(90, 62, 43, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 200ms cubic-bezier(0.22, 0.9, 0.3, 1), box-shadow 200ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

.coffee-content:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(90, 62, 43, 0.18), 0 6px 16px rgba(0, 0, 0, 0.08);
}

.coffee-text {
    background: linear-gradient(145deg, var(--color-coffee-brown) 0%, var(--color-coffee-dark) 100%);
    padding: var(--spacing-3xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

/* Floating Coffee Icons */
.coffee-text::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23F5E6D3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='0.12'%3E%3Cpath d='M17 8h1a4 4 0 1 1 0 8h-1'/%3E%3Cpath d='M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z'/%3E%3Cline x1='6' y1='2' x2='6' y2='4'/%3E%3Cline x1='10' y1='2' x2='10' y2='4'/%3E%3Cline x1='14' y1='2' x2='14' y2='4'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23F5E6D3' stroke-width='1.5' opacity='0.08'%3E%3Cellipse cx='12' cy='12' rx='10' ry='4'/%3E%3Cpath d='M12 8v8'/%3E%3C/svg%3E");
    background-position: 15% 20%, 80% 70%;
    background-repeat: no-repeat;
    background-size: 32px, 24px;
    animation: floatIcons 8s ease-in-out infinite;
}

@keyframes floatIcons {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: translate(4px, -6px);
        opacity: 0.85;
    }
}

.coffee-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-light);
    color: var(--color-coffee-cream);
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

.coffee-description {
    font-size: var(--text-base);
    color: rgba(245, 230, 211, 0.85);
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

.coffee-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-coffee-cream);
}

.feature-icon {
    font-size: var(--text-lg);
}

.feature-text {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.btn-outline-coffee {
    background-color: transparent;
    color: var(--color-coffee-cream);
    border: 1.5px solid var(--color-coffee-cream);
    padding: 1rem 2.5rem;
    font-size: 0.9375rem;
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all 180ms cubic-bezier(0.22, 0.9, 0.3, 1);
    position: relative;
    z-index: 1;
    align-self: flex-start;
}

.btn-outline-coffee:hover {
    background-color: var(--color-coffee-cream);
    color: var(--color-coffee-brown);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(90, 62, 43, 0.3);
}

.coffee-visual {
    position: relative;
    overflow: hidden;
}

.coffee-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

.coffee-content:hover .coffee-visual img {
    transform: scale(1.02);
}

.coffee-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(90, 62, 43, 0.15) 0%, transparent 30%);
    pointer-events: none;
}

/* Quick View Modal */
.quick-view-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay, 10000);
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.quick-view-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.quick-view-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    animation: modalSlideIn var(--transition-slow) ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: rotate(90deg);
}

.modal-close svg {
    stroke: #fff;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--color-bg-light);
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: var(--spacing-3xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.modal-product-name {
    font-size: var(--text-3xl);
    font-weight: var(--font-light);
    color: var(--color-text);
}

.modal-product-model {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
}

.modal-product-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.modal-product-features .feature {
    font-size: var(--text-base);
}

/* Modal Redirect Info */
.modal-redirect-info {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08) 0%, rgba(0, 86, 179, 0.08) 100%);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 8px;
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.redirect-message {
    font-size: var(--text-base);
    color: var(--color-text);
    text-align: center;
    font-weight: var(--font-medium);
    direction: rtl;
}

.redirect-timer {
    display: inline-block;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: #007bff;
    min-width: 24px;
    text-align: center;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Modal Actions */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: auto;
}

.btn-cancel {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-base);
    border-radius: 4px;
    font-family: 'Vazir', Tahoma, sans-serif;
}

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.25);
    color: var(--color-text);
}

.btn-cancel:active {
    transform: scale(0.98);
}

.modal-actions .btn-primary {
    order: -1;
}

/* Responsive: Tablet */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--spacing-lg);
    }

    .category-header {
        height: 35vh;
        min-height: 280px;
    }

    .category-header-overlay {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    .coffee-content {
        grid-template-columns: 1fr;
    }

    .coffee-text {
        padding: var(--spacing-2xl);
        order: 2;
    }

    .coffee-visual {
        order: 1;
        min-height: 280px;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-info {
        padding: var(--spacing-2xl);
    }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .products-hero {
        height: 30vh;
        min-height: 240px;
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-subtitle {
        font-size: var(--text-base);
    }

    .category-section {
        padding: var(--spacing-2xl) var(--container-padding);
    }

    .category-header {
        height: 30vh;
        min-height: 240px;
        border-radius: 8px;
    }

    .category-header-overlay {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .category-title {
        font-size: var(--text-2xl);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .coffee-capsules-section {
        padding: var(--spacing-2xl) var(--spacing-sm);
    }

    .coffee-content {
        border-radius: 12px;
    }

    .coffee-text {
        padding: var(--spacing-xl);
        gap: var(--spacing-md);
    }

    .coffee-title {
        font-size: var(--text-2xl);
    }

    .coffee-description {
        font-size: var(--text-sm);
    }

    .coffee-visual {
        min-height: 220px;
    }

    .modal-info {
        padding: var(--spacing-xl);
    }

    .modal-product-name {
        font-size: var(--text-2xl);
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-image {
        aspect-ratio: 4/3;
    }

    .redirect-message {
        font-size: var(--text-sm);
    }

    .redirect-timer {
        font-size: var(--text-lg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--color-text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.3;
}

.empty-state-text {
    font-size: var(--text-lg);
}
