* {
    box-sizing: border-box;
}

:root {
    --primary: #2A1710;
    --secondary: #7A4A2E;
    --accent: #C99663;
    --bg: #F7F1EA;
    --surface: #FFFFFF;
    --text: #1E1714;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: #efe3d8;
    color: var(--text);
    direction: rtl;
}

a {
    text-decoration: none;
    color: inherit;
}

.app-shell {
    width: min(100%, 480px);
    min-height: 100vh;
    margin: 0 auto;
    background: #fff;
    overflow-x: hidden;
    padding-bottom: 96px;
    box-shadow: 0 0 45px rgba(42, 23, 16, 0.08);
}

.home-header {
    background: #fff;
    padding: 12px 18px 14px;
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(42, 23, 16, 0.06);
}

.logo-wrap {
    height: 82px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-wrap img {
    width: 118px;
    max-height: 78px;
    object-fit: contain;
    display: block;
}

.top-tabs {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-top: 4px;
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
}

.top-tabs a {
    color: rgba(30, 23, 20, 0.45);
}

.top-tabs a.active {
    color: var(--secondary);
}

.search-card {
    margin-top: 14px;
    height: 56px;
    border-radius: 17px;
    background: #f3f0ed;
    color: rgba(30, 23, 20, 0.52);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 600;
}

.search-icon {
    font-size: 24px;
}

.hero-scroll {
    display: flex;
    direction: ltr;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding: 16px 16px 4px;
}

.hero-scroll::-webkit-scrollbar {
    display: none;
}

.hero-card {
    direction: rtl;
    min-width: calc(100vw - 44px);
    max-width: 430px;
    height: 285px;
    border-radius: 0;
    padding: 24px;
    overflow: hidden;
    background-color: #5d4034;
    background-size: cover;
    background-position: center;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
    box-shadow: 0 14px 34px rgba(42, 23, 16, 0.22);
}

.hero-card h1 {
    margin: 0;
    font-size: 29px;
    line-height: 1.2;
    max-width: 320px;
    letter-spacing: -0.5px;
}

.hero-card p {
    margin: 10px 0 16px;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255,255,255,0.9);
    max-width: 300px;
}

.hero-card .btn {
    align-self: flex-start;
    background: #fff;
    color: var(--primary);
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 900;
    font-size: 13px;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 10px 0 4px;
}

.slider-dots span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(42, 23, 16, 0.18);
}

.slider-dots span:first-child {
    width: 20px;
    background: var(--secondary);
}

.section-head {
    padding: 20px 18px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: ltr;
}

.section-head h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.4px;
}

.section-head span {
    background: #161616;
    color: #fff;
    padding: 5px 9px;
    transform: rotate(-2deg);
    display: inline-block;
    margin-left: 5px;
}

.section-head a {
    font-size: 13px;
    color: rgba(30,23,20,0.72);
    font-weight: 800;
}

.tiles-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 12px;
    padding: 0 16px 20px;
    direction: ltr;
}

.tile {
    direction: rtl;
    min-height: 145px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background-color: #eee8e2;
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 24px rgba(42, 23, 16, 0.10);
}

.tile:first-child {
    grid-row: span 2;
    min-height: 302px;
}

.tile-content {
    position: absolute;
    inset: auto 10px 10px 10px;
    background: rgba(255,255,255,0.94);
    border-radius: 14px;
    padding: 10px 12px;
    backdrop-filter: blur(8px);
}

.tile-content strong {
    display: block;
    font-size: 16px;
    color: var(--primary);
}

.tile-content small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: rgba(30,23,20,0.62);
}

.how-card {
    margin: 4px 16px 24px;
    border: 1px solid rgba(122,74,46,0.13);
    border-radius: 24px;
    padding: 18px;
    background: #fffaf5;
}

.how-card h2 {
    margin: 0 0 14px;
    font-size: 21px;
}

.steps {
    display: grid;
    gap: 10px;
}

.step {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    color: rgba(30,23,20,0.78);
}

.step b {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.footer-credit {
    text-align: center;
    padding: 24px 14px 8px;
    color: rgba(30,23,20,0.45);
    font-size: 12px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    width: min(calc(100% - 24px), 450px);
    height: 70px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(122,74,46,0.14);
    border-radius: 28px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    box-shadow: 0 14px 40px rgba(42, 23, 16, 0.18);
    backdrop-filter: blur(12px);
    z-index: 50;
}

.bottom-nav a {
    text-align: center;
    font-size: 10px;
    color: rgba(30,23,20,0.58);
    font-weight: 900;
}

.bottom-nav a b {
    display: block;
    font-size: 21px;
    line-height: 1;
    margin-bottom: 4px;
    color: rgba(30,23,20,0.68);
}

.bottom-nav a.active,
.bottom-nav a.active b {
    color: var(--secondary);
}

.coming-soon {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
    text-align: center;
}

.coming-soon-card {
    max-width: 360px;
    background: #fff;
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 20px 55px rgba(42,23,16,0.12);
}

.coming-soon-card img {
    width: 115px;
    object-fit: contain;
}

.coming-soon-card h1 {
    margin: 20px 0 14px;
    font-size: 26px;
}

.loader {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(122,74,46,0.16);
    border-top-color: var(--secondary);
    border-radius: 50%;
    margin: 0 auto 18px;
    animation: spin 1s linear infinite;
}

.back-home {
    display: inline-flex;
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 800;
}

.terms-page {
    padding: 20px 18px 110px;
}

.terms-logo {
    display: block;
    width: 112px;
    margin: 0 auto 20px;
}

.terms-page h1 {
    font-size: 27px;
    margin: 0 0 16px;
}

.terms-block {
    background: #fffaf5;
    border: 1px solid rgba(122,74,46,0.12);
    border-radius: 22px;
    padding: 16px;
    margin-bottom: 12px;
}

.terms-block h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.terms-block p {
    margin: 0;
    line-height: 1.8;
    font-size: 14px;
    color: rgba(30,23,20,0.72);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (min-width: 520px) {
    .hero-card {
        min-width: 430px;
    }
}

/* V5 Explore refinement */
.tiles-grid {
    align-items: stretch;
}

.tile:nth-child(4),
.tile:nth-child(5) {
    min-height: 145px;
}

.tile:nth-child(5) {
    grid-column: span 1;
}

@media (max-width: 360px) {
    .tiles-grid {
        gap: 10px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .tile {
        min-height: 132px;
    }

    .tile:first-child {
        min-height: 280px;
    }
}

/* IT inline edit keys */
.editable-home {
    position: relative;
}

.it-edit-key {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 8;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255,255,255,0.94);
    color: #7A4A2E;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 8px 24px rgba(42,23,16,.18);
    border: 1px solid rgba(122,74,46,.18);
}

.logo-edit-key {
    top: 8px;
    left: 18px;
}

.hero-link,
.tile-link {
    display: block;
    color: inherit;
}

.hero-link {
    min-width: calc(100vw - 44px);
    max-width: 430px;
    scroll-snap-align: center;
}

.hero-link .hero-card {
    min-width: 100%;
    max-width: 100%;
}

@media (min-width: 520px) {
    .hero-link {
        min-width: 430px;
    }
}
