/* ==========================================================================
   Coffee World Page - Tekno Time
   Premium, editorial, boutique coffee experience
   RTL-first, minimalist design
   ========================================================================== */

/* Coffee World Variables */
:root {
    --coffee-espresso: #2C1810;
    --coffee-dark: #3D2A1E;
    --coffee-brown: #5A3E2B;
    --coffee-medium: #8B6914;
    --coffee-cream: #F5E6D3;
    --coffee-light: #FAF7F2;
    --coffee-gold: #C9A962;
    --coffee-accent: #D4A574;
}

/* ========== Hero Section - Video ========== */
.coffee-hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    background: var(--coffee-espresso);
    overflow: hidden;
}

.hero-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-video-wrapper {
    width: 100%;
    height: 70vh;
    position: relative;
    overflow: hidden;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--coffee-espresso) 0%, var(--coffee-dark) 50%, var(--coffee-brown) 100%);
    color: var(--coffee-cream);
    text-align: center;
    padding: var(--spacing-xl);
}

/* کلاس اصلاح شده */
.hero-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    /* تغییرات مهم: */
    background: transparent; /* پس‌زمینه رنگی حذف شد تا عکس دیده شود */
    color: var(--coffee-cream);
    text-align: center;
    padding: var(--spacing-xl);
    
    /* اضافه کردن سایه برای خوانایی متن روی عکس */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* اگر نیاز دارید که فقط لبه‌ها تیره باشند و وسط عکس دیده شود، 
می‌توانید از این کد به جای کد بالا استفاده کنید: */
/*
.hero-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(44, 24, 16, 0.7), rgba(44, 24, 16, 0.3)); 
    color: var(--coffee-cream);
    text-align: center;
    padding: var(--spacing-xl);
}
*/

.hero-placeholder-text {
    font-size: var(--text-xl);
    font-weight: var(--font-light);
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* ========== Machine Section (formerly Hero) ========== */
.machine-section {
    position: relative;
    padding: var(--spacing-3xl) var(--container-padding);
    background: linear-gradient(135deg, var(--coffee-espresso) 0%, var(--coffee-dark) 50%, var(--coffee-brown) 100%);
    overflow: hidden;
}

.machine-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(201, 169, 98, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(212, 165, 116, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.machine-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.machine-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
    align-items: center;
}

.machine-text {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.machine-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(201, 169, 98, 0.15);
    border: 1px solid rgba(201, 169, 98, 0.3);
    padding: 0.5rem 1rem;
    font-size: var(--text-xs);
    color: var(--coffee-gold);
    font-weight: var(--font-medium);
    width: fit-content;
    backdrop-filter: blur(8px);
}

.badge-icon {
    flex-shrink: 0;
    color: var(--coffee-gold);
    stroke: var(--coffee-gold);
}

.machine-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: var(--font-light);
    color: var(--coffee-cream);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.machine-tagline {
    font-size: var(--text-xl);
    color: rgba(245, 230, 211, 0.85);
    font-weight: var(--font-light);
    line-height: 1.6;
}

.machine-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.machine-feature {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--coffee-cream);
    font-size: var(--text-sm);
}

.machine-feature-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 169, 98, 0.25);
    border-radius: 50%;
    padding: 6px;
    flex-shrink: 0;
    color: var(--coffee-cream);
    stroke: var(--coffee-cream);
}

.machine-cta {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.btn-coffee-primary {
    background: var(--coffee-gold);
    color: var(--coffee-espresso);
    border: none;
    padding: 1rem 2rem;
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-coffee-primary:hover {
    background: var(--coffee-cream);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 169, 98, 0.3);
}

.btn-coffee-outline {
    background: transparent;
    color: var(--coffee-cream);
    border: 1.5px solid rgba(245, 230, 211, 0.5);
    padding: 1rem 2rem;
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-coffee-outline:hover {
    border-color: var(--coffee-cream);
    background: rgba(245, 230, 211, 0.1);
}

/* Machine Visual */
.machine-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.machine-showcase {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.machine-image {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 40px 80px rgba(0, 0, 0, 0.4));
    transition: transform 600ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.machine-showcase:hover .machine-image {
    transform: scale(1.02);
}

/* Micro Animation Sequence */
.brew-sequence {
    position: absolute;
    bottom: 20%;
    right: 10%;
    display: flex;
    gap: var(--spacing-xs);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brew-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-xs);
    opacity: 0.5;
    transition: opacity var(--transition-base);
}

.brew-step.active {
    opacity: 1;
}

.brew-step-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--coffee-cream);
    stroke: var(--coffee-cream);
}

.brew-step-label {
    font-size: 0.625rem;
    color: var(--coffee-cream);
    white-space: nowrap;
}

/* ========== Why T-C14 + Capsules Section ========== */
.why-section {
    padding: var(--spacing-3xl) var(--container-padding);
    background: linear-gradient(180deg, var(--coffee-espresso) 0%, var(--coffee-dark) 100%);
    position: relative;
}

.why-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(201, 169, 98, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.why-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.why-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-light);
    color: var(--coffee-cream);
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
}

.why-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-xl);
    transition: all var(--transition-base);
}

.why-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(201, 169, 98, 0.3);
    transform: translateY(-4px);
}

.why-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--coffee-cream);
    stroke: var(--coffee-cream);
    flex-shrink: 0;
}

.why-card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--coffee-cream);
    margin-bottom: var(--spacing-sm);
}

.why-card-text {
    font-size: var(--text-sm);
    color: rgba(245, 230, 211, 0.85);
    line-height: 1.6;
}

/* ========== Taste Wheel / Presets Section ========== */
.taste-section {
    padding: var(--spacing-3xl) var(--container-padding);
    background: var(--coffee-light);
}

.taste-container {
    max-width: 1400px;
    margin: 0 auto;
}

.taste-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.taste-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-light);
    color: var(--coffee-espresso);
    margin-bottom: var(--spacing-sm);
}

.taste-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
}

/* Preset Filters */
.taste-presets {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-2xl);
    flex-wrap: wrap;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md) var(--spacing-xl);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 120px;
}

.preset-btn:hover,
.preset-btn.active {
    border-color: var(--coffee-brown);
    box-shadow: 0 4px 16px rgba(90, 62, 43, 0.12);
}

.preset-btn.active {
    background: var(--coffee-brown);
    color: #fff;
}

.preset-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.preset-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.preset-range {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.preset-btn.active .preset-range {
    color: rgba(255, 255, 255, 0.8);
}

/* Taste Wheel Visual */
.taste-wheel-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-2xl);
}

.taste-wheel {
    position: relative;
    width: 280px;
    height: 280px;
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-segment:hover,
.wheel-segment.active {
    transform: scale(1.05);
    z-index: 2;
}

.segment-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========== Capsules Grid ========== */
.capsules-section {
    padding: var(--spacing-3xl) var(--container-padding);
    background: #fff;
}

.capsules-container {
    max-width: 1400px;
    margin: 0 auto;
}

.capsules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-2xl);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.capsules-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-light);
    color: var(--coffee-espresso);
}

.capsules-count {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Capsule Grid */
.capsules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
    max-width: 1400px;
}

/* Capsule Card */
.capsule-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 400ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.capsule-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(90, 62, 43, 0.12);
    border-color: rgba(90, 62, 43, 0.15);
}

.capsule-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--coffee-light) 0%, #fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.capsule-color-accent {
    position: absolute;
    inset: 0;
    opacity: 0.6;
    transition: opacity 400ms ease;
    pointer-events: none;
}

.capsule-card:hover .capsule-color-accent {
    opacity: 0.8;
}

.capsule-color-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2;
    transition: transform 400ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.capsule-card:hover .capsule-color-badge {
    transform: scale(1.1) rotate(10deg);
}

.color-badge-icon {
    color: white;
    stroke: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.capsule-pack-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.capsule-card:hover .capsule-pack-image {
    transform: scale(1.05);
}



/* Capsule Info */
.capsule-info {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex: 1;
}

.capsule-origin {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 300ms ease;
}

.capsule-origin svg {
    flex-shrink: 0;
    stroke: currentColor;
}

.capsule-name {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--coffee-espresso);
    line-height: 1.3;
    margin-bottom: 4px;
}

.capsule-tasting {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    flex: 1;
}

.capsule-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: var(--spacing-md);
    margin-top: auto;
}

.capsule-availability {
    font-size: var(--text-sm);
    color: var(--coffee-gold);
    font-weight: var(--font-medium);
    text-align: center;
}

/* Capsule Actions */
.capsule-actions {
    margin-top: var(--spacing-md);
}

.btn-view-product {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    background: var(--coffee-espresso);
    color: #fff;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    will-change: transform;
    animation: breathe 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.btn-view-product::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(201, 169, 98, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 500ms ease;
}

.btn-view-product::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color, var(--coffee-gold));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 400ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.btn-view-product:hover::after {
    transform: scaleX(1);
}

.btn-view-product:hover {
    background: var(--coffee-brown);
    transform: translateY(-3px) scale(1);
    box-shadow: 0 12px 32px rgba(90, 62, 43, 0.35);
    animation-play-state: paused;
}

.btn-view-product:hover::before {
    opacity: 1;
}

.btn-view-product:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 6px 16px rgba(90, 62, 43, 0.25);
}

.btn-view-product:focus {
    outline: 2px solid var(--coffee-gold);
    outline-offset: 3px;
    animation-play-state: paused;
}



/* ========== Editorial Section ========== */
.editorial-section {
    padding: var(--spacing-3xl) var(--container-padding);
    background: linear-gradient(180deg, var(--coffee-light) 0%, #fff 100%);
}

.editorial-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.editorial-quote {
    font-size: var(--text-2xl);
    font-weight: var(--font-light);
    color: var(--coffee-espresso);
    line-height: 1.6;
    font-style: italic;
    margin-bottom: var(--spacing-lg);
}

.editorial-attribution {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .hero-video-wrapper {
        height: 60vh;
    }

    .machine-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .machine-text {
        align-items: center;
    }

    .machine-visual {
        order: -1;
    }

    .machine-showcase {
        max-width: 350px;
    }

    .brew-sequence {
        position: relative;
        bottom: auto;
        right: auto;
        justify-content: center;
        margin-top: var(--spacing-md);
    }

    .why-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .capsules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .coffee-hero {
        min-height: auto;
    }

    .hero-video-wrapper {
        height: 50vh;
    }

    .machine-section {
        padding: var(--spacing-2xl) var(--container-padding);
    }

    .machine-title {
        font-size: var(--text-3xl);
    }

    .machine-tagline {
        font-size: var(--text-base);
    }

    .machine-cta {
        flex-direction: column;
        width: 100%;
    }

    .btn-coffee-primary,
    .btn-coffee-outline {
        width: 100%;
        text-align: center;
    }

    .why-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .taste-presets {
        gap: var(--spacing-sm);
    }

    .preset-btn {
        min-width: 100px;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .capsules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .capsule-image-wrapper {
        aspect-ratio: 4 / 3;
    }

    .capsule-info {
        padding: var(--spacing-md);
    }

    .capsule-name {
        font-size: var(--text-lg);
    }

    .capsule-actions {
        flex-direction: column;
    }

    .editorial-quote {
        font-size: var(--text-xl);
    }
}

@media (max-width: 480px) {
    .capsules-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== Animations ========== */
@keyframes brewCycle {
    0%, 100% { opacity: 0.5; }
    33% { opacity: 1; }
}

.brew-step:nth-child(1) { animation: brewCycle 3s ease-in-out infinite 0s; }
.brew-step:nth-child(2) { animation: brewCycle 3s ease-in-out infinite 1s; }
.brew-step:nth-child(3) { animation: brewCycle 3s ease-in-out infinite 2s; }

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(90, 62, 43, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 24px rgba(90, 62, 43, 0.3), 0 0 0 2px rgba(201, 169, 98, 0.15);
    }
}

/* Focus States for Accessibility */
.preset-btn:focus,
.capsule-card:focus-within {
    outline: 2px solid var(--coffee-gold);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--coffee-gold);
    outline-offset: 2px;
}
