:root {
    --bg-dark: #121212;
    --bg-card: #1C1C1E;
    --bg-panel: #262629;
    --text-main: #F5F5F7;
    --text-muted: #86868B;
    --brand-orange: #FF6600;
    --border-color: #38383A;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none;
    /* Globally hide default cursor */
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Heebo', sans-serif;
    line-height: 1.5;
    text-align: right;
    direction: rtl;
}

/* --- MAGIC CURSOR (Oukitel Orange) --- */
#magic-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 102, 0, 0.5);
    /* Brand Orange Ring */
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out, width 0.3s, height 0.3s, border-radius 0.3s, border-color 0.3s;
    mix-blend-mode: exclusion;
}

#magic-pointer {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--brand-orange);
    /* Brand Orange Dot */
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.05s linear;
    /* Snappier follow */
}

/* Cursor States */
#magic-cursor.locked {
    border-color: var(--brand-orange);
    /* Solid orange on lock */
    background: rgba(255, 102, 0, 0.1);
    /* Slight fill */
    mix-blend-mode: normal;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

/* --- TOP HEADER --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: rtl;
}

/* Logo Image */
.logo-link {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    /* Adjust based on logo aspect ratio */
    width: auto;
    object-fit: contain;
}

.desktop-nav {
    display: flex;
    gap: 2rem;
}

.desktop-nav a {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    transition: 0.3s;
    font-size: 1.1rem;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--brand-orange);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #FFF;
    font-size: 1.8rem;
}

/* --- MOBILE DRAWER (RTL: Slide from Right) --- */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: #1C1C1E;
    z-index: 2000;
    padding: 2rem;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    text-align: right;
}

.mobile-drawer.open {
    right: 0;
}

.close-drawer-btn {
    align-self: flex-end;
    /* In RTL, this puts it on Left */
    background: none;
    border: none;
    color: #AAA;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.mobile-nav-links a {
    display: block;
    font-size: 1.5rem;
    color: #EEE;
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.mobile-nav-links a:hover {
    color: var(--brand-orange);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* --- HERO --- */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: radial-gradient(circle at center, #2C2C2E 0%, #121212 70%);
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 3.5rem;
    letter-spacing: -1px;
    background: linear-gradient(180deg, #FFF 0%, #999 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.hero .subtitle {
    color: var(--brand-orange);
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

/* --- GRID LAYOUT --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    border-right: 4px solid var(--brand-orange);
    padding-right: 15px;
    color: #FFF;
    text-align: right;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 5rem;
    align-items: start;
    /* Fix: Prevent stretch/fake opening */
}

/* --- PRODUCT CARD --- */
.product-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--brand-orange);
}

/* Image Area */
.card-image-area {
    height: 320px;
    position: relative;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent);
    overflow: hidden;
    margin-bottom: 0;
}

.card-img {
    position: absolute;
    bottom: 25px;
    height: 80%;
    width: auto;
    object-fit: contain;
    transition: 0.5s ease;
}

/* RTL Overlapping Logic */
.img-front {
    z-index: 2;
    left: 50%;
    transform: translateX(-55%);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.img-back {
    z-index: 1;
    left: 50%;
    transform: translateX(-25%);
    filter: brightness(0.6) blur(0.5px);
}

.product-card:hover .img-front {
    transform: translateX(-70%) scale(1.05);
}

.product-card:hover .img-back {
    transform: translateX(-15%) scale(1.05);
    filter: brightness(1) blur(0);
}

.card-content {
    padding: 1.5rem;
    text-align: right;
    position: relative;
    z-index: 5;
    background: var(--bg-card);
    /* Cover bottom of image if needed */
}

.model-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.marketing-text {
    color: var(--brand-orange);
    font-size: 0.95rem;
    font-weight: 500;
}

/* --- APPLE STYLE PANEL (Strict RTL) --- */
.feature-panel {
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    /* Force default row direction! */
    min-height: 280px;
    direction: rtl;
    /* Ensure RTL inside */
    width: 100%;
}

/* Right Nav List */
/* In RTL: First Child (Nav) -> Right, Second Child (Content) -> Left */
.panel-nav {
    width: 35%;
    flex: 0 0 35%;
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px solid var(--border-color);
    /* Separator on LEFT */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-btn {
    padding: 1rem 1.2rem;
    text-align: right;
    /* Text aligns right */
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    border-right: 3px solid transparent;
    /* Highlight on RIGHT */
    transition: 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
}

.panel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFF;
}

.panel-btn.active {
    background: rgba(255, 102, 0, 0.1);
    color: #FFF;
    border-right-color: var(--brand-orange);
}

/* Left Content Area */
.panel-content {
    width: 65%;
    flex: 0 0 65%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: right;
    /* Text aligns right */
    overflow: hidden;
    /* Prevent overflow */
}

.panel-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.panel-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.spec-highlight {
    margin-bottom: 1.5rem;
}

.big-val {
    font-size: 1.6rem;
    /* Slightly reduced */
    font-weight: 800;
    color: #FFF;
    line-height: 1.2;
    display: block;
    margin-bottom: 0.3rem;
    word-wrap: break-word;
    /* Allows breaking very long words */
    word-break: break-word;
    hyphens: auto;
    /* Hyphenate if possible */
}

.sub-val {
    font-size: 0.95rem;
    color: #AAA;
    display: block;
}

/* Full Specs Accordion */
.specs-accordion {
    border-top: 1px solid var(--border-color);
    background: #151515;
}

.accordion-summary {
    padding: 1.2rem 1.5rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #DDD;
    direction: rtl;
}

.specs-table {
    padding: 0 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 2rem;
    font-size: 0.9rem;
    direction: rtl;
}

.specs-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0;
}

.spec-label {
    color: #888;
    text-align: right;
}

.spec-data {
    color: #EEE;
    direction: ltr;
    text-align: left;
}

/* Keep LTR nums */

/* --- FOOTER --- */
.main-footer {
    padding: 2rem;
    text-align: center;
    color: #86868B;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

/* --- RESPONSIVE --- */

/* Tablet (2 columns) */
@media (max-width: 1100px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (1 column + adjusted header) */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Panel: Horizontal Scroll */
    .feature-panel {
        flex-direction: column;
    }

    .panel-nav {
        width: 100%;
        flex: 0 0 auto;
        flex-direction: row;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
        overflow-x: auto;
        white-space: nowrap;
        background: var(--bg-card);
    }

    .panel-btn {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 3px solid transparent;
        /* Highlight moves to bottom */
        padding: 0.8rem 1.2rem;
        text-align: center;
    }

    .panel-btn.active {
        border-right-color: transparent;
        border-bottom-color: var(--brand-orange);
    }

    .panel-content {
        width: 100%;
        flex: 1;
        padding: 1.5rem;
        min-height: 200px;
    }

    .specs-table {
        grid-template-columns: 1fr;
        gap: 0;
    }
}