/* Desktop website layout. Mobile (under 768px) stays the PWA app. */

.navbar-menu .nav-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

.navbar-menu .nav-theme input {
  position: relative;
  width: 40px;
  height: 40px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  appearance: none;
  cursor: pointer;
}

.navbar-menu .nav-theme input::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffc107' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E") center / 20px no-repeat;
}

.navbar-menu .nav-theme input:checked::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffe08a'%3E%3Cpath d='M21 14.5A8.5 8.5 0 1 1 9.5 3a7 7 0 0 0 11.5 11.5z'/%3E%3C/svg%3E");
}

@media (max-width: 767px) {
  body:has(> .navbar-menu) {
    padding-top: 64px;
  }

  .navbar-menu {
    right: 14px;
    left: 14px;
    width: auto;
    max-width: none;
    -webkit-transform: none;
    transform: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    filter: none;
  }

  body:has(> .navbar-menu)::before {
    content: "";
    position: fixed;
    z-index: 39;
    top: 0;
    right: 0;
    left: 0;
    height: 60px;
    background: rgba(18, 38, 54, 0.94);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    backdrop-filter: blur(40px) saturate(1.6);
  }

  .navbar-menu::before {
    content: "کیان‌وود";
    position: fixed;
    z-index: 41;
    top: 12px;
    right: 16px;
    width: auto;
    height: 36px;
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    background: none;
  }

  .navbar-menu .nav-theme {
    position: fixed;
    z-index: 41;
    top: 10px;
    left: 12px;
  }

  .service-strip {
    margin-top: 22px;
  }
}

@media (min-width: 768px) {
  :root {
    --site-width: 1180px;
  }

  html {
    background: #e7edf2;
  }

  html:has(body.dark) {
    background: #050d14;
  }

  html:has(body.auth-body) {
    background: #122636;
  }

  body:not(.auth-body) {
    max-width: none;
    width: 100%;
    height: auto;
    min-height: 100vh;
    margin: 0;
    background: #f4f6f8;
    box-shadow: none;
  }

  body.dark:not(.auth-body) {
    background: #0c1b27;
  }

  body:not(.auth-body) .custom-container {
    width: min(var(--site-width), 100%);
    max-width: var(--site-width);
    margin-inline: auto;
    padding-inline: 24px;
  }

  body:not(.auth-body) > section {
    padding-top: 28px;
  }

  body:has(> .navbar-menu) {
    padding-top: 78px;
    padding-bottom: 40px;
  }

  body:has(> .navbar-menu) .sidebar-btn {
    display: none !important;
  }

  body:has(> .navbar-menu) .header {
    justify-content: flex-start;
    gap: 18px;
  }

  body:has(> .navbar-menu) header.section-t-space {
    padding-top: 22px;
    padding-bottom: 0;
  }

  .header .head-content .header-info h2 {
    font-size: 22px;
    font-weight: 700;
  }

  .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
  }

  .title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
  }

  .title a {
    font-size: 14px;
    font-weight: 600;
    color: #122636;
  }

  .search-head .form-control.search {
    min-height: 52px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(18, 38, 54, 0.08);
    box-shadow: 0 8px 22px rgba(18, 38, 54, 0.04);
  }

  .banner-wapper .banner-bg .img-bg {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 22px;
  }

  .banner-wapper .banner-bg .banner-content {
    top: 28px;
    right: 28px;
  }

  .banner-wapper .banner-bg .banner-content h2 {
    font-size: 30px;
    font-weight: 700;
  }

  .banner-wapper .banner-bg .banner-content h4 {
    width: auto;
    max-width: 320px;
    font-size: 16px;
  }

  .banner-wapper .banner-bg .more-btn {
    right: 28px;
    bottom: 24px;
  }

  .grid-banner .banner-bg .img-bg {
    height: 220px;
  }

  .swiper.categories {
    overflow: visible;
  }

  .swiper.categories .swiper-wrapper {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100% !important;
    transform: none !important;
  }

  .swiper.categories .swiper-slide {
    width: auto !important;
    margin: 0 !important;
  }

  .swiper.categories .swiper-slide-duplicate {
    display: none !important;
  }

  .categories-item {
    min-height: 54px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(18, 38, 54, 0.06);
    box-shadow: 0 6px 16px rgba(18, 38, 54, 0.04);
  }

  .categories-item .categories-img {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 10px;
    overflow: hidden;
  }

  .categories-item .categories-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .categories-item h4 {
    margin: 0;
    font-weight: 600;
  }

  .categories-item.active {
    background: #122636;
    border-color: #122636;
    color: #fff;
  }

  /* Bottom tab bar becomes a full-width site header. */
  .navbar-menu {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px max(24px, calc((100% - var(--site-width)) / 2));
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: 0 10px 28px rgba(18, 38, 54, 0.16);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    -webkit-transform: none;
    transform: none;
    display: flex;
    align-items: center;
    gap: 18px;
  }

  .navbar-menu::after {
    background: rgba(18, 38, 54, 0.94);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    backdrop-filter: blur(40px) saturate(1.6);
    border-radius: 0;
    box-shadow: none;
  }

  body.dark .navbar-menu::after {
    background: rgba(8, 18, 28, 0.96);
  }

  .navbar-menu::before {
    content: "کیان‌وود";
    position: static;
    flex: 0 0 auto;
    width: auto;
    height: 42px;
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    background: none;
  }

  .navbar-menu ul {
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 6px;
  }

  .navbar-menu ul li {
    flex: 0 0 auto;
  }

  .navbar-menu ul li,
  .navbar-menu ul li a {
    color: rgba(255, 255, 255, 0.72);
  }

  .navbar-menu ul li a {
    flex-direction: row;
    gap: 8px;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 12px;
  }

  .navbar-menu ul li a span {
    font-size: 14px;
    color: inherit;
  }

  .navbar-menu ul li.active a {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: none;
  }

  .navbar-menu ul li.active .icon .active {
    filter: brightness(0) invert(1);
  }

  .navbar-menu ul li.active a span {
    color: #fff;
  }

  .navbar-menu ul li:not(.active) a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .navbar-menu .nav-theme {
    position: static;
    margin-inline-start: auto;
  }

  section.panel-space:has(+ .navbar-menu) {
    display: none !important;
    padding: 0 !important;
    height: 0 !important;
  }

  .row > .col-6:has(> .product-box) {
    flex: 0 0 auto;
    width: 33.333333%;
  }

  .row > .col-12:has(> .horizontal-product-box) {
    flex: 0 0 auto;
    width: 50%;
  }

  .product-box {
    background: #fff;
    border: 1px solid rgba(18, 38, 54, 0.06);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 10px 24px rgba(18, 38, 54, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .product-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(18, 38, 54, 0.08);
  }

  .product-box .product-box-img .img {
    height: 200px;
    border-radius: 14px;
    background: #f7f8fa;
  }

  .product-box .like-btn {
    overflow: hidden;
    font-size: 0;
    color: transparent;
  }

  .horizontal-product-box {
    background: #fff;
    border: 1px solid rgba(18, 38, 54, 0.06);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(18, 38, 54, 0.04);
  }

  body.dark .product-box,
  body.dark .horizontal-product-box,
  body.dark .categories-item:not(.active),
  body.dark .search-head .form-control.search {
    background: rgba(var(--light-bg), 1);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .categories-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .categories-list li {
    margin-top: 0;
  }

  .pay-popup,
  .address-form .footer-modal,
  .profile-setting .footer-modal,
  .shipping-details-sec .apply-btn,
  .details-page .fixed-cart-btn {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    -webkit-transform: none;
    transform: none;
  }

  .pay-popup,
  .address-form .footer-modal,
  .profile-setting .footer-modal,
  .shipping-details-sec .apply-btn {
    padding-inline: max(24px, calc((100vw - var(--site-width)) / 2));
  }

  .details-page .top-image {
    display: none;
  }

  .product-page-header {
    max-width: none;
    width: 100%;
  }

  .search-filter .footer-modal {
    left: 50%;
    right: auto;
    width: min(1120px, 100%);
    max-width: 1120px;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
  }

  /* Login and account pages: full-bleed photo, centered card. */
  body.auth-body:has(.auth-img) {
    max-width: none;
    width: 100%;
    height: auto;
    min-height: 100vh;
    margin: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    background: #122636;
  }

  body.auth-body:has(.auth-img) .auth-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    object-fit: cover;
    z-index: 0;
  }

  body.auth-body:has(.auth-img) .auth-img,
  body.auth-body:has(.auth-img) .auth-form,
  body.auth-body:has(.auth-img) > .custom-container {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
  }

  body.auth-body:has(.auth-img) .auth-img {
    background: rgba(18, 38, 54, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 28px 22px 0;
  }

  body.auth-body:has(.auth-img) .auth-content {
    position: static;
    display: block;
    width: auto;
    height: auto;
    padding: 0;
  }

  body.auth-body:has(.auth-img) .auth-form,
  body.auth-body:has(.auth-img) > .custom-container {
    background: rgba(18, 38, 54, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-top: none;
    border-radius: 0 0 20px 20px;
    padding: 4px 22px 28px;
    margin: 0;
  }

  body.auth-body:has(.auth-img) .auth-form .custom-container {
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
  }

  body.auth-body:has(.auth-img) .division span {
    background: #1a3346;
  }

  /* Onboarding splash stays its own column on the dark page. */
  body.auth-body:not(:has(.auth-img)) {
    max-width: 600px;
    height: auto;
    min-height: 100vh;
    box-shadow: none;
  }
}

@media (min-width: 992px) {
  .details-page:not(.details-page2) {
    display: block;
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
  }

  .details-page:not(.details-page2) .product-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 32px 40px;
    align-items: start;
  }

  .details-page:not(.details-page2) .product-stage > section:has(.product-image-slider) {
    position: sticky;
    top: 24px;
    align-self: start;
    z-index: 1;
  }

  .details-page:not(.details-page2) > .similer-product {
    position: relative;
    z-index: 2;
    margin-top: 36px;
  }

  .details-page:not(.details-page2) .fixed-cart-btn {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: none;
    margin-top: 20px;
    padding: 0;
    background: transparent;
    z-index: auto;
    transform: none;
  }

  .details-page:not(.details-page2) .custom-container {
    width: 100%;
    max-width: none;
  }

  .details-page:not(.details-page2) .product-image-slider .product-img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
  }
}

@media (min-width: 1100px) {
  .swiper.categories .swiper-wrapper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .banner-wapper .banner-bg .img-bg {
    height: 380px;
  }

  .row > .col-6:has(> .product-box) {
    width: 25%;
  }

  .product-box .product-box-img .img {
    height: 210px;
  }
}

.service-strip {
  padding: 4px 0 2px;
}

.service-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-cards li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(18, 38, 54, 0.06);
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(18, 38, 54, 0.04);
}

.service-icon {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f6f1e6;
  color: #8a6a32;
}

.service-icon svg {
  width: 20px;
  height: 20px;
}

.service-copy strong,
.service-copy small {
  display: block;
}

.service-copy strong {
  color: #122636;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.service-copy small {
  color: #6b7782;
  font-size: 12px;
}

.site-footer {
  display: none;
}

body.dark .service-cards li {
  background: #122636;
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark .service-icon {
  background: rgba(255, 224, 138, 0.12);
  color: #ffe08a;
}

body.dark .service-copy strong {
  color: #f4f7fa;
}

body.dark .service-copy small {
  color: rgba(255, 255, 255, 0.62);
}

.theme-logo .logo-img {
  display: none;
}

.theme-logo::after {
  content: "کیان‌وود";
  display: block;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
}

@media (min-width: 768px) {
  .service-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .service-copy strong {
    font-size: 14px;
  }

  .site-footer {
    display: block;
    margin-top: 36px;
    padding: 16px 0 4px;
    border-top: 1px solid rgba(18, 38, 54, 0.08);
    color: #6b7782;
    font-size: 12.5px;
    line-height: 1.7;
  }

  .site-footer p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 0;
  }

  .site-footer p + p {
    margin-top: 2px;
  }

  .site-footer strong {
    color: #122636;
    font-weight: 700;
  }

  .site-footer strong + span::before,
  .site-footer span + span::before,
  .site-footer-links a + a::before {
    content: "·";
    margin: 0 8px;
    color: #c3cbd2;
  }

  .site-footer a {
    color: #122636;
    font-weight: 600;
    text-decoration: none;
  }

  body.dark .site-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.62);
  }

  body.dark .site-footer strong,
  body.dark .site-footer a {
    color: #f4f7fa;
  }
}

/* Checkout bar stays above the floating tab bar on phones. */
.pay-popup {
  z-index: 35;
}

body:has(.pay-popup) section.panel-space:has(+ .navbar-menu) {
  padding-top: 200px !important;
}

@media (max-width: 767px) {
  .pay-popup {
    right: 14px;
    left: 14px;
    bottom: 104px;
    width: auto;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    box-shadow:
      0 14px 36px rgba(18, 38, 54, 0.14),
      0 2px 8px rgba(18, 38, 54, 0.06);
    -webkit-transform: none;
    transform: none;
  }

  .pay-popup .price-items {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .pay-popup .price-items h6,
  .pay-popup .price-items h2 {
    margin: 0;
  }

  .pay-popup .pay-btn,
  [dir="rtl"] .pay-popup .pay-btn {
    width: 100%;
    min-height: 48px;
    margin: 0;
    justify-content: center;
    border-radius: 16px;
    font-weight: 700;
  }

  body:has(.pay-popup) section.panel-space:has(+ .navbar-menu) {
    padding-top: 248px !important;
  }
}

@media (min-width: 768px) {
  .pay-popup {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    gap: 28px;
    padding: 16px max(24px, calc((100vw - var(--site-width)) / 2));
    border-radius: 0;
    box-shadow: 0 -8px 28px rgba(18, 38, 54, 0.08);
    -webkit-transform: none;
    transform: none;
  }

  .pay-popup .pay-btn,
  [dir="rtl"] .pay-popup .pay-btn {
    min-width: 200px;
    min-height: 48px;
    margin: 0;
    justify-content: center;
    border-radius: 14px;
    font-weight: 700;
  }

  body:has(.pay-popup) {
    padding-bottom: 120px;
  }
}

/* Step mark is a check only. The circle comes from the step span.
   Completed circles are navy in light mode and black in dark mode, so
   the mark stays white. Pending marks follow the theme color: navy on
   the white circle, white on the near-black dark-mode circle. */
.order-tracking .order-process .process-icon {
  width: 20px;
  height: 20px;
  display: block;
  color: rgba(var(--theme-color), 1);
}

.order-tracking .order-process.completed .process-icon {
  color: #fff;
}

.order-product-box .horizontal-product-details h3 {
  margin-inline-end: 12px;
}

.address-section .address-switch {
  flex: 0 0 auto;
  border: 1px solid rgba(var(--theme-color), 0.22);
  background: transparent;
  color: rgba(var(--theme-color), 1);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.bill-details .theme-btn {
  min-height: 48px;
  height: auto;
  margin-top: 16px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
}

.details-page .similer-product,
.details-page .similer-product .swiper-wrapper,
body.dark .similer-product,
body.dark .similer-product .swiper-wrapper {
  background: transparent;
  background-color: transparent;
  box-shadow: none;
}

.order-product-box .horizontal-product-box .horizontal-product-details .product-status {
  margin-inline-end: 12px;
  padding-inline-start: 16px;
}
