:root {
    --bg-main: #FAF8F4;
    --bg-card: #FFFFFF;
    --terracotta: #C9784A;
    --terracotta-dark: #A86036;
    --coffee-brown: #6B4B3E;
    --beige: #EFE7DD;
    --text-dark: #2A2412;
    --text-muted: #8C7B6B;
    --shadow-soft: 0 4px 20px rgba(107, 75, 62, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background: var(--bg-dynamic, #FCFBF8);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(201, 120, 74, 0.08), transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(107, 75, 62, 0.08), transparent 50%);
    background-size: 200% 200%;
    animation: gradientMesh 15s ease infinite;
    transition: background-color 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes gradientMesh {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Splash Screen (Frosted Glass) --- */
.v2-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(42, 36, 18, 0.5);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.5s;
}

.v2-splash-glass {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(20px);
    opacity: 0;
    animation: floatUpSplash 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.2s;
}

.v2-splash-logo {
    width: 120px;
    height: 120px;
    background: #fff;
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 0 40px rgba(201, 168, 106, 0.5);
    margin-bottom: 25px;
}

.v2-splash-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.v2-splash-brand {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 6px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

@keyframes floatUpSplash {
    to { transform: translateY(0); opacity: 1; }
}

.v2-splash.hidden {
    opacity: 0;
    visibility: hidden;
}

/* --- Header --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--bg-main);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 100;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--coffee-brown);
    font-size: 1.4rem;
    cursor: pointer;
}

.cart-btn {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--terracotta);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    text-align: center;
    color: var(--coffee-brown);
}

.logo-crown {
    font-size: 1.2rem;
    margin-bottom: -5px;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-sub {
    font-size: 0.6rem;
    letter-spacing: 3px;
    color: var(--text-muted);
}

/* --- App Container --- */
.app-container {
    display: flex;
    flex-direction: row-reverse; /* Puts sidebar on the physical left in RTL */
    padding-top: 80px; /* offset for header */
    padding-bottom: 100px; /* offset for footer */
}

/* --- Sidebar --- */
.sidebar {
    width: 100px;
    background-color: var(--terracotta);
    border-top-right-radius: 40px; /* Smooth curve on top right */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    position: fixed;
    left: 0;
    top: 80px; /* Start below header */
    bottom: 0;
    z-index: 50;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    position: relative;
    align-items: center;
}
.nav-indicator {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    z-index: 0;
    transition: transform 0.6s cubic-bezier(0.5, 1.5, 0.4, 1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    top: 0;
}

.nav-item {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
    z-index: 1;
}

.nav-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.nav-text {
    font-size: 0.8rem;
    font-weight: 600;
}

.nav-item.active {
    color: #fff;
}

.nav-item.active .nav-icon {
    background-color: var(--bg-main);
    color: var(--terracotta);
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-top: 2rem;
}

.floral-deco {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.special-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* --- Content Area --- */
.content-area {
    flex-grow: 1;
    margin-left: 100px; /* Space for sidebar on the left */
    width: calc(100% - 100px);
}

.hero {
    padding: 0 1rem 1.5rem 1rem;
}

.hero-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 40px;
    border-bottom-left-radius: 80px; /* Signature organic curve */
    box-shadow: var(--shadow-soft);
}

/* --- Products --- */
.product-container {
    padding: 0 1rem;
}

.category-section {
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    color: var(--coffee-brown);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    padding-right: 0.5rem;
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    bottom: -5px;
    width: 40px;
    height: 3px;
    background-color: var(--terracotta);
    border-radius: 2px;
}

.product-card {
    background-color: var(--bg-card);
    border-radius: 24px;
    padding: 0.8rem;
    display: flex;
    flex-direction: row-reverse;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1rem;
    position: relative;
    opacity: 0;
    transform: perspective(1000px) translateX(100px) rotateY(15deg);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    transform-style: preserve-3d;
}

.product-card.reveal {
    opacity: 1;
    transform: perspective(1000px) translateX(0) rotateY(0deg);
}

.product-card.tilt {
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.product-img {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    object-fit: cover;
    background-color: var(--beige);
    transform: translateZ(40px);
    transition: transform 0.3s ease;
}

.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 1.5rem;
    transform: translateZ(20px);
    transition: transform 0.3s ease;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
}

.product-name-en {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.product-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--terracotta);
}

.product-price span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.add-btn {
    position: absolute;
    bottom: 0.8rem;
    left: 0.8rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--terracotta);
    color: #FFF;
    border: none;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(201, 120, 74, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.add-btn:active {
    transform: scale(0.85) rotate(90deg);
    background-color: #A65A31;
}

/* --- Floating Footer --- */
.floating-footer {
    position: fixed;
    bottom: 15px;
    left: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.8rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--beige);
    z-index: 100;
}

.footer-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: var(--coffee-brown);
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    font-size: 0.65rem;
}

.footer-btn i {
    font-size: 1.2rem;
}

.f-title {
    font-weight: 700;
}

.f-sub {
    font-size: 0.55rem;
    color: var(--text-muted);
}

/* --- Interactive Animations --- */
.pulse-anim {
    animation: badgePulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--coffee-brown);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- Ripple Effect --- */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.6s linear;
    background-color: rgba(201, 120, 74, 0.3); /* Terracotta tint */
    pointer-events: none;
}

@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* --- 3D & Parallax Adjustments --- */
.product-card {
    /* Existing properties are in .product-card already, we just add to it */
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden; 
}

/* Magnetic Items */
.magnetic {
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

/* Sidebar Toggle Functionality */
.sidebar {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}
.content-area {
    transition: margin-left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
body.sidebar-hidden .sidebar {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}
body.sidebar-hidden .content-area {
    margin-left: 0;
    width: 100%;
}

/* RESPONSIVE-DESKTOP: تابلت وشاشات كبيرة */
@media (min-width: 900px) {
  .hero { max-width: 980px; margin-left: auto; margin-right: auto; }
  .category-section { max-width: 980px; margin-left: auto; margin-right: auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.3rem; }
  .category-section .section-title { grid-column: 1 / -1; }
  .product-card:hover { transform: translateY(-4px); box-shadow: 0 18px 45px rgba(0,0,0,.18); }
}
@media (min-width: 1450px) {
  .hero, .category-section { max-width: 1200px; }
  .category-section { grid-template-columns: 1fr 1fr 1fr; }
}
