/* ==========================================================================
   RESPONSIVE STYLES (تحسينات شاملة للويب والموبايل والتابلت)
   ========================================================================== */

/* Tablets & Small Laptops (max-width: 1080px) */
@media (max-width: 1080px) {
  .desktop-nav,
  .login-link {
    display: none;
  }

  .menu-btn {
    display: flex;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .opportunity-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-search-fields {
    grid-template-columns: 1.5fr 1fr 1fr auto;
  }

  .dual-value-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .dual-connector {
    display: none;
  }

  .process-line {
    grid-template-columns: repeat(2, 1fr);
  }

  .process-line::before {
    display: none;
  }

  .scale-grid,
  .app-layout,
  .story-grid,
  .contact-layout,
  .calculator-layout,
  .detail-layout,
  .form-layout,
  .faq-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .form-layout > aside,
  .faq-layout aside,
  .detail-gallery {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

/* Medium Tablets & Large Phones (max-width: 860px) */
@media (max-width: 860px) {
  .hero-glass-search {
    padding: 0.85rem;
    border-radius: var(--radius-xl);
  }

  .search-tabs {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .search-tab-group {
    width: 100%;
    overflow-x: auto;
    padding-block-end: 0.35rem;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .search-tab-group::-webkit-scrollbar {
    display: none;
  }

  .search-tab {
    flex-shrink: 0;
  }

  .hero-search-fields {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .search-submit-btn {
    width: 100%;
    height: 46px;
  }

  .thesis-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Phones (max-width: 768px) - Comprehensive Premium Overhaul */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .container {
    width: min(calc(100% - 1.25rem), var(--container));
    padding-inline: 0.5rem;
  }

  .section {
    padding-block: clamp(2.5rem, 5vw, 3.5rem);
  }

  .section-head {
    margin-block-end: 1.75rem;
    text-align: center;
  }

  .section-head h2 {
    font-size: clamp(1.4rem, 5vw, 1.85rem);
    line-height: 1.3;
    margin-block-end: 0.5rem;
    text-align: center;
  }

  .section-head .lead {
    font-size: 0.88rem;
    line-height: 1.55;
    text-align: center;
    max-width: 100%;
  }

  /* Header & Navigation */
  .brand img {
    width: 115px;
    height: auto;
  }

  .site-header {
    padding-block: 0.4rem;
  }

  .nav-shell {
    height: 54px;
    padding: 0 0.75rem;
  }

  .nav-actions {
    gap: 0.35rem;
  }

  .nav-actions .btn-secondary,
  .nav-actions .icon-btn {
    display: none;
  }

  .nav-actions .btn-primary {
    white-space: nowrap !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0.25rem 0.65rem !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--radius-full);
  }

  .btn {
    min-height: 36px;
    padding: 0.4rem 0.95rem;
    font-size: 0.82rem;
  }

  /* Hero Section Mobile (Centered Everything) */
  .hero {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    padding-block: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
  }

  .hero-layout {
    padding-block-start: 3.8rem;
    padding-block-end: 0.5rem;
    gap: 0.35rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(1.3rem, 5.2vw, 1.65rem);
    line-height: 1.25;
    margin-block-end: 0.35rem;
    text-align: center;
    margin-inline: auto;
  }

  .hero-lead {
    font-size: 0.82rem;
    margin-block-end: 0.65rem;
    line-height: 1.5;
    max-width: 92%;
    text-align: center;
    margin-inline: auto;
  }

  .hero-glass-search {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 16px;
    margin-inline: auto;
  }

  .search-tabs {
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-block-end: 0.5rem;
  }

  .search-tab-group {
    width: 100%;
    justify-content: center;
    gap: 0.25rem;
  }

  .search-tab {
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
  }

  .search-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
  }

  .hero-search-fields {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .search-field {
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
  }

  .search-field label {
    font-size: 0.68rem;
  }

  .search-field input,
  .search-field select {
    font-size: 0.82rem;
    height: 22px;
  }

  .search-submit-btn {
    width: 100%;
    height: 42px;
    font-size: 0.86rem;
    border-radius: 10px;
  }

  .hero-trust-strip {
    gap: 0.3rem;
    margin-block-start: 0.45rem;
    justify-content: center;
  }

  .trust-item {
    font-size: 0.68rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
  }

  /* Service Cards Mobile (Compact Box Sizes) */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .service-card {
    padding: 1.15rem 1rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px -2px rgba(6, 30, 49, 0.05);
  }

  .service-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin-block-end: 0.65rem;
  }

  .service-card h2 {
    font-size: 1.05rem;
    margin-block-end: 0.35rem;
  }

  .service-card p {
    font-size: 0.82rem;
    line-height: 1.5;
    margin-block-end: 0.75rem;
  }

  .service-link {
    font-size: 0.82rem;
  }

  /* Duality Cards Mobile (Compact & Balanced) */
  .dual-value-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 100%;
  }

  .dual-connector {
    display: none;
  }

  .dual-card {
    padding: 1.45rem 1.25rem;
    border-radius: 20px;
    box-shadow: 0 8px 24px -4px rgba(6, 30, 49, 0.08);
  }

  .dual-card-header {
    margin-block-end: 0.85rem;
    gap: 0.55rem;
  }

  .role-badge {
    font-size: 0.82rem;
    padding: 0.28rem 0.72rem;
  }

  .role-icon {
    font-size: 1.15rem;
  }

  .benefit-tag {
    font-size: 0.74rem;
    padding: 0.22rem 0.58rem;
  }

  .dual-card-title {
    font-size: 1.18rem;
    line-height: 1.35;
    margin-block-end: 0.45rem;
  }

  .dual-card-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    margin-block-end: 0.95rem;
  }

  .dual-feature-list {
    gap: 0.55rem;
    margin-block-end: 1.15rem;
  }

  .dual-feature-list li {
    font-size: 0.88rem;
    line-height: 1.48;
    gap: 0.55rem;
  }

  .check-icon {
    width: 20px;
    height: 20px;
    font-size: 0.72rem;
  }

  .dual-card-footer {
    gap: 0.75rem;
  }

  .deal-highlight {
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
    border-radius: 10px;
  }

  .btn-block {
    min-height: 44px;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  /* 5-Step Process Mobile (Sleek Compact Step Boxes) */
  .process-line {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .process-line::before {
    display: none;
  }

  .process-line li {
    padding: 0.95rem 0.9rem;
    border-radius: 14px;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    text-align: right;
  }

  .process-line b {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
    margin-block-end: 0;
    flex-shrink: 0;
  }

  .process-line h3 {
    font-size: 0.95rem;
    margin-block: 0 0.2rem;
  }

  .process-line p {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  /* Market Section & 3D Phone Mockup Mobile */
  .app-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .app-layout h2 {
    font-size: 1.4rem;
    text-align: center;
  }

  .app-layout .lead {
    text-align: center;
    font-size: 0.85rem;
  }

  .app-features-list {
    margin: 1rem 0 1.25rem;
    gap: 0.55rem;
    text-align: right;
  }

  .app-features-list li {
    font-size: 0.82rem;
    gap: 0.55rem;
  }

  .market-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin-block: 1rem;
  }

  .market-stat-card {
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
  }

  .market-stat-label {
    font-size: 0.68rem;
    margin-block-end: 0.15rem;
  }

  .market-stat-val {
    font-size: 1.2rem;
  }

  .market-stat-sub {
    font-size: 0.65rem;
    margin-block-start: 0.15rem;
  }

  .phone-mockup-container {
    width: 100%;
    margin-inline: auto;
  }

  .phone-device {
    width: min(290px, 86vw);
    height: 580px;
    min-height: 560px;
    padding: 8px;
    border-radius: 40px;
    margin-inline: auto;
  }

  .phone-screen {
    border-radius: 32px;
    padding: 10px 10px 8px;
  }

  .phone-unit-title {
    font-size: 0.92rem;
  }

  .phone-unit-sub {
    font-size: 0.68rem;
  }

  .phone-specs-pill {
    font-size: 0.6rem;
    padding: 0.12rem 0.4rem;
  }

  .phone-qr-box {
    padding: 6px 8px;
    gap: 8px;
  }

  .phone-qr-img {
    width: 38px;
    height: 38px;
  }

  .phone-qr-text strong {
    font-size: 0.72rem;
  }

  .phone-qr-text small {
    font-size: 0.6rem;
  }

  .phone-price-val {
    font-size: 0.95rem;
  }

  .phone-btn {
    padding: 0.22rem 0.55rem;
    font-size: 0.62rem;
    min-height: 24px;
    white-space: nowrap;
  }

  /* Opportunity Grid Mobile */
  .opportunity-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .opportunity-card {
    border-radius: 16px;
  }

  .card-media {
    height: 160px;
  }

  .card-body {
    padding: 0.95rem;
  }

  .card-body h3 {
    font-size: 1.05rem;
  }

  .specs-row {
    font-size: 0.72rem;
  }

  .cash-block strong {
    font-size: 1.25rem;
  }

  /* Comparison Showcase Mobile */
  .comparison-showcase {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .compare-vs-divider {
    display: none;
  }

  .compare-side-card {
    padding: 1.5rem 1.25rem;
    border-radius: 20px;
  }

  .compare-side-header {
    margin-block-end: 1.25rem;
    padding-bottom: 1rem;
  }

  .compare-side-title {
    font-size: 1.25rem;
  }

  .compare-point-list {
    gap: 1rem;
  }

  .point-text {
    font-size: 0.88rem;
  }

  .compare-labels {
    display: none;
  }

  .compare-grid article {
    border-radius: 16px;
  }

  .compare-grid article h3 {
    padding: 0.85rem 1rem;
    font-size: 1.02rem;
  }

  .compare-grid article p {
    padding: 0.65rem 0.9rem;
    font-size: 0.8rem;
    line-height: 1.4;
    gap: 0.15rem;
  }

  /* Final Choice Mobile (Clean Compact Cards) */
  .final-choice-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .final-choice-card {
    background: linear-gradient(145deg, #f0fdf4 0%, #e6f9f0 100%) !important;
    border: 1.5px solid rgba(0, 176, 116, 0.28) !important;
    padding: 1.2rem 1.1rem !important;
    border-radius: 18px !important;
  }

  .final-choice-card.alt {
    background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%) !important;
  }

  .final-choice-card h2 {
    color: #032117 !important;
    font-size: 1.15rem;
    margin-block-end: 0.4rem;
  }

  .final-choice-card p,
  .final-choice-card .lead {
    color: #164e3f !important;
    font-size: 0.84rem;
    line-height: 1.5;
    margin-block-end: 1rem !important;
  }

  .final-choice-card .btn {
    min-height: 34px !important;
    padding: 0.38rem 0.9rem !important;
    font-size: 0.8rem !important;
    width: 100% !important;
  }

  /* Inner Pages Hero Section Mobile (Centered Everything) */
  .page-hero {
    padding-block: 2.75rem 2rem;
    text-align: center;
  }

  .page-hero .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .page-hero h1 {
    font-size: clamp(1.4rem, 5.5vw, 1.85rem);
    line-height: 1.3;
    text-align: center;
    margin-inline: auto;
    margin-block-end: 0.65rem;
  }

  .page-hero .lead {
    font-size: 0.86rem;
    line-height: 1.55;
    text-align: center;
    margin: 0 auto;
  }

  .page-hero-badge {
    font-size: 0.72rem;
    padding: 0.25rem 0.75rem;
    margin-inline: auto;
    margin-block-end: 0.85rem;
  }

  .page-hero-breadcrumbs {
    font-size: 0.75rem;
    margin-inline: auto;
    justify-content: center;
    margin-block-end: 0.75rem;
  }

  .page-hero .container > div,
  .page-hero .page-hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
    margin-block-start: 1.25rem !important;
  }

  .page-hero .container > div .btn {
    width: 100%;
    justify-content: center;
  }

  /* Forms & Interactive Calculators Mobile */
  .field-grid,
  .result-compare,
  .detail-finance,
  .calculator-layout,
  .form-layout,
  .contact-layout,
  .detail-layout,
  .faq-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .lead-form,
  .calc-form,
  .calc-result,
  .form-box {
    padding: 1.15rem 1rem !important;
    border-radius: 16px !important;
  }

  .form-progress {
    margin: -1.15rem -1rem 1.25rem !important;
    font-size: 0.8rem;
  }

  .field {
    margin-block-end: 0.75rem;
  }

  .field label {
    font-size: 0.8rem;
    margin-block-end: 0.3rem;
  }

  .field input,
  .field select,
  .field textarea {
    padding: 0.6rem 0.85rem;
    font-size: 0.86rem;
    border-radius: 10px;
    height: 44px;
  }

  .field textarea {
    height: auto;
  }

  .form-actions {
    gap: 0.65rem;
    flex-direction: column;
  }

  .form-actions button,
  .form-actions a {
    width: 100%;
    justify-content: center;
  }

  /* Redesigned Luxury Mobile Footer (شكل الفوتر الجديد والمميز في الموبايل) */
  .site-footer {
    padding-block: 2.75rem 2rem;
    background: linear-gradient(180deg, #061d30 0%, #03111e 100%);
    border-block-start: 1.5px solid rgba(0, 176, 116, 0.2);
    text-align: center;
  }

  .footer-grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    align-items: center;
    text-align: center;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .footer-brand img {
    margin-inline: auto;
    max-width: 150px;
    height: auto;
  }

  .footer-brand p {
    font-size: 0.82rem;
    line-height: 1.55;
    margin-block: 0.65rem 1rem;
    text-align: center;
    color: #9ab1c1;
    max-width: 90%;
  }

  .footer-contact-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
  }

  .footer-contact-links a {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 0.42rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
  }

  .footer-contact-links a:hover {
    background: rgba(0, 176, 116, 0.2);
    border-color: rgba(0, 176, 116, 0.4);
    color: #72f0b7;
  }

  /* Compact Footer Sections on Mobile */
  .footer-grid > div:not(.footer-brand) {
    width: 100%;
    border-block-start: 1px solid rgba(255, 255, 255, 0.08);
    padding-block-start: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .site-footer h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #72f0b7;
    margin-block: 0 0.65rem;
  }

  .site-footer a {
    font-size: 0.84rem;
    color: #cbd5e1;
    margin-block: 0.35rem;
    padding: 0.15rem 0.5rem;
  }

  .site-footer a:hover {
    color: #ffffff;
    transform: none;
  }

  .footer-bottom {
    margin-block-start: 1.75rem;
    padding-block-start: 1.25rem;
    flex-direction: column;
    text-align: center;
    gap: 0.65rem;
    font-size: 0.76rem;
    color: #7b94a5;
    border-block-start: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Assistant Widget Mobile */
  .assistant-launcher {
    inset-inline-end: 1rem;
    inset-block-end: 1rem;
    padding: 0.55rem 0.95rem;
    font-size: 0.82rem;
  }

  .assistant {
    inset-inline: 0.75rem;
    width: auto;
    inset-block-end: 4.25rem;
    border-radius: 20px;
    max-height: 80vh;
  }
}

/* Very Small Phones (max-width: 420px) */
@media (max-width: 420px) {
  body {
    font-size: 15px;
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .btn {
    min-height: 34px;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
  }

  .phone-device {
    width: 275px;
    height: 550px;
  }

  .market-stats-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Reduced Motion Support (Accessibility) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
