/* ===========================
   FRiENDi Mobile — Responsive + RTL
   Strategy: Desktop untouched
   Mobile: hide original header, 
   show custom injected header via JS
   =========================== */

/* ===== COUNTRY SELECTOR (works on all sizes) ===== */
.country-selector {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,.15);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  margin-left: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  position: relative;
  vertical-align: middle;
}
.country-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  z-index: 200;
  min-width: 160px;
  margin-top: 5px;
  overflow: hidden;
}
.country-dropdown.open { display: block; }
.country-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s;
  text-decoration: none;
}
.country-dropdown a:hover { background: #f0faf9; }
.country-dropdown a.active { background: #e0f7f5; color: #00BFB3; }

/* ===== RTL SUPPORT (works on all sizes) ===== */
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .outer-content .widget { float: right; }
[dir="rtl"] .outer-footer .footer-top { text-align: right; }
[dir="rtl"] .article-detail { direction: rtl; text-align: right; }
[dir="rtl"] .wrap-wid ul { padding-right: 20px; padding-left: 0; }

/* ===== MOBILE HEADER (injected by JS) ===== */
.mobile-header {
  display: none; /* only shown on mobile via media query */
}

/* =============================================
   MOBILE ONLY (≤768px)
   ============================================= */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  html, body { overflow-x: hidden !important; }

  /* HIDE entire original header */
  .outer-header { display: none !important; }

  /* SHOW custom mobile header */
  .mobile-header {
    display: block !important;
    background: linear-gradient(135deg, #00BFB3, #009e96);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
  }
  .mobile-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
  }
  .mobile-header__logo img {
    height: 40px;
    width: auto;
  }
  .mobile-header__right {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-header__lang {
    background: rgba(255,255,255,.2);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  .mobile-header__burger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
  }
  .mobile-header__burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
    transition: .3s;
  }
  .mobile-header__burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
  .mobile-header__burger.active span:nth-child(2) { opacity: 0; }
  .mobile-header__burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }
  .mobile-header__phone {
    display: block;
    text-align: center;
    background: rgba(0,0,0,.08);
    color: #fff;
    font-size: 11px;
    padding: 4px 0;
  }
  .mobile-header__phone a { color: #fff; text-decoration: none; font-weight: 600; }

  /* Mobile nav */
  .mobile-nav {
    display: none;
    background: #008f89;
  }
  .mobile-nav.open { display: block; }
  .mobile-nav a {
    display: block;
    padding: 13px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.1);
    transition: background .15s;
  }
  .mobile-nav a:hover, .mobile-nav a:active { background: rgba(0,0,0,.08); }

  /* === SLIDER: mobile banner === */
  .spotlight {
    display: none !important;
  }
  .mobile-banner {
    display: block !important;
    background: linear-gradient(135deg, #00d4aa 0%, #00BFB3 50%, #009e96 100%);
    padding: 25px 20px;
    text-align: center;
    color: #fff;
  }
  .mobile-banner h2 {
    font-size: 20px;
    margin: 0 0 8px;
    font-weight: 700;
  }
  .mobile-banner h2 span { color: #FFB800; }
  .mobile-banner p {
    font-size: 14px;
    margin: 0 0 15px;
    opacity: .9;
  }
  .mobile-banner .btn {
    display: inline-block;
    background: #FFB800;
    color: #333;
    font-weight: 700;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0,0,0,.2);
    transition: transform .2s;
  }
  .mobile-banner .btn:active { transform: scale(.96); }
  .shade-header { display: none !important; }

  /* === CONTAINERS === */
  .container_12 {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 12px !important;
  }
  .outer-content, .outer-footer {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6,
  .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12 {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    clear: both !important;
  }
  .alpha, .omega { margin: 0 !important; }

  /* === WIDGETS === */
  .grid_4.widget, .grid_4.omega, .widget-round, .widget-round.top-up {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin: 0 0 15px 0 !important;
    position: relative !important;
    overflow: visible !important;
    height: auto !important;
  }
  .widget h2, .widget-round h2 {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 12px 15px !important;
    overflow: visible !important;
  }
  .widget h2 a, .widget-round h2 a {
    font-size: 15px !important;
    display: block !important;
    white-space: normal !important;
    line-height: 1.3 !important;
  }
  .widget .wrap-wid {
    padding: 10px 15px !important;
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
  }
  .widget .wrap-wid ul { margin: 0 !important; padding: 0 0 0 18px !important; }
  .widget .wrap-wid li { font-size: 14px !important; line-height: 1.6 !important; }
  .widget .wrap-wid p { font-size: 13px !important; padding: 5px 0 !important; }
  .widget .more, .widget-round .more {
    position: relative !important;
    display: block !important;
    clear: both !important;
    margin: 8px 15px 15px !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
  }
  .tl, .tr, .bl, .br { display: none !important; }

  /* === ARTICLE PAGES === */
  .article-detail { overflow-x: auto; }
  .article-detail h1 { font-size: 20px !important; }
  .article-detail table { font-size: 12px; width: 100% !important; }
  .article-detail th, .article-detail td { padding: 7px 8px !important; }

  /* === FOOTER === */
  .outer-footer .footer-top { text-align: center; }
  .outer-footer .footer-top nav.footer { float: none !important; }
  .outer-footer .footer-top nav.footer ul { display: block !important; float: none !important; text-align: center; }
  .outer-footer .footer-top nav.footer ul li { display: block !important; float: none !important; margin: 5px 0 !important; }
  .outer-footer .footer-top nav.social { float: none !important; text-align: center; clear: both !important; }
  .outer-footer .footer-top nav.social ul { display: inline-flex !important; gap: 10px; float: none !important; }
  .outer-footer .footer-top nav.social ul li { float: none !important; }
  .outer-footer .footer-top .copyright { text-align: center !important; }
  .outer-footer .sitemap .nav-sitemap {
    width: 50% !important; float: left !important; margin-bottom: 10px;
  }

  /* RTL Mobile */
  [dir="rtl"] .mobile-header__right { flex-direction: row-reverse; }
  [dir="rtl"] .mobile-nav a { text-align: right; }
  [dir="rtl"] .mobile-banner { direction: rtl; }
}

/* ===== SMALL MOBILE (≤480px) ===== */
@media (max-width: 480px) {
  .mobile-header__logo img { height: 35px !important; }
  .mobile-banner h2 { font-size: 18px; }
  .outer-footer .sitemap .nav-sitemap {
    width: 100% !important; float: none !important; text-align: center;
  }
}

/* Mobile banner hidden on desktop */
.mobile-banner { display: none; }
