/**
 * ICTech sitewide responsive — desktop / tablet / mobile
 * Breakpoints: 1100 · 900 · 768 · 600 · 480
 * Loaded last so it can override component styles.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}
body {
  overflow-x: clip;
  max-width: 100%;
}
img,
video,
iframe,
canvas {
  max-width: 100%;
  height: auto;
}
/* Don't force height:auto on SVGs — collapses viewBox icons in the header */
svg {
  max-width: 100%;
}

.ictech-header,
.ictech-footer,
.ictech-home,
.ictech-page,
.ictech-about-page,
.ictech-section,
.ictech-trust,
.woocommerce ul.products,
.ct-container,
.ct-container-full {
  max-width: 100%;
}

/* Full-bleed pages: avoid 100vw scrollbar overflow on small screens */
@media (max-width: 900px) {
  .ictech-page,
  .ictech-about-page {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* —— Comfortable tap targets —— */
@media (max-width: 900px) {
  .ictech-header__nav-item,
  .ictech-header__account-btn,
  .ictech-card__cart,
  .ictech-section__filter,
  .ictech-section__more-btn,
  .ictech-filter-card__head,
  .ictech-footer__pill {
    min-height: 44px;
  }
}

/* =========================================================
   HEADER
   ========================================================= */
@media (max-width: 1100px) {
  .ictech-header__top {
    gap: 12px 16px;
    padding: 12px 16px;
  }
  .ictech-header__logo {
    height: 64px;
    max-width: 110px;
  }
  .ictech-header__title {
    font-size: 20px;
  }
  .ictech-header__nav-inner {
    justify-content: flex-start;
    gap: 2px;
    padding: 0 12px;
  }
  .ictech-header__nav-item {
    padding: 12px 10px;
    font-size: 13px;
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .ictech-header__top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand account"
      "search search";
    align-items: center;
    gap: 10px 12px;
    padding: 10px 12px;
  }
  .ictech-header__brand {
    grid-area: brand;
    min-width: 0;
  }
  .ictech-header__account {
    grid-area: account;
    justify-self: end;
    gap: 6px;
  }
  .ictech-header__search {
    grid-area: search;
    max-width: none;
    margin: 0;
    width: 100%;
  }
  .ictech-header__subtitle {
    display: none;
  }
  .ictech-header__logo {
    height: 48px;
    max-width: 84px;
  }
  .ictech-header__title {
    font-size: 17px;
  }
  /* Icon-only account/cart */
  .ictech-header__btn-label,
  .ictech-header__cart-label {
    display: none;
  }
  .ictech-header__account-btn {
    padding: 0 !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    justify-content: center;
    gap: 0 !important;
  }
  .ictech-header__account-btn svg,
  .ictech-header__cart-icon svg {
    width: 18px !important;
    height: 18px !important;
    max-width: none !important;
    flex-shrink: 0;
    display: block;
  }
  .ictech-header__cart-icon {
    display: inline-flex;
    line-height: 0;
  }
  .ictech-header__nav {
    border-top: 1px solid var(--ictech-border, #e5e7eb);
  }
  .ictech-header__nav-inner {
    display: flex;
    justify-content: flex-start;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 8px;
    scroll-snap-type: x proximity;
  }
  .ictech-header__nav-inner::-webkit-scrollbar {
    display: none;
  }
  .ictech-header__nav-item {
    scroll-snap-align: start;
    flex: 0 0 auto;
    padding: 12px 12px;
  }
  .ictech-header__nav-item > svg:last-child {
    /* chevron */
    opacity: 0.55;
  }

  /* Mega: full-bleed sheet under nav (outside scroll row so not clipped) */
  .ictech-header {
    z-index: 10080;
  }
  .ictech-header__nav {
    z-index: 10090;
  }
  .ictech-mega {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    top: var(--ictech-mega-top, 0px);
    transform: none !important;
    border-radius: 0 0 14px 14px;
    max-height: min(75vh, 640px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-left: 0;
    border-right: 0;
    z-index: 10095 !important;
  }
  .ictech-mega__columns {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-height: none;
    overflow: visible;
  }
  .ictech-mega--repair.is-open,
  .ictech-mega--protection.is-open,
  .ictech-mega--accessories.is-open {
    grid-template-columns: 1fr !important;
    min-height: 0;
  }
  .ictech-mega__devices {
    display: flex !important;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    border-right: 0 !important;
    border-bottom: 1px solid var(--ictech-border, #e5e7eb);
    padding: 10px;
  }
  .ictech-mega__device {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }
  .ictech-mega__models {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    max-height: none;
    padding: 14px;
  }
  html.ictech-mega-open {
    overflow: hidden;
  }
  html.ictech-mega-open body {
    overflow: hidden;
  }
}

@media (max-width: 600px) {
  .ictech-header__logo {
    height: 40px;
    max-width: 68px;
  }
  .ictech-header__title {
    font-size: 15px;
  }
  .ictech-header__brand {
    gap: 8px;
  }
  .ictech-header__search input[type="search"] {
    padding: 10px 12px;
    font-size: 14px;
  }
  .ictech-header__search button {
    min-width: 46px;
    padding: 0 12px;
  }
  .ictech-mega__columns {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   HOMEPAGE
   ========================================================= */
@media (max-width: 1100px) {
  .ictech-home {
    padding-left: 16px;
    padding-right: 16px;
  }
  .ictech-section__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .ictech-trust {
    padding-left: 16px;
    padding-right: 16px;
  }
  .ictech-trust__inner {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .ictech-home {
    padding: 0 12px 36px;
  }
  .ictech-slider-wrap {
    margin: 16px auto 24px;
    gap: 8px;
  }
  .ictech-slider__slide {
    padding: 28px 22px 48px;
    min-height: 240px;
  }
  .ictech-section__head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .ictech-section__filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .ictech-section__filters::-webkit-scrollbar {
    display: none;
  }
  .ictech-section__filter {
    flex: 0 0 auto;
  }
  .ictech-section__title {
    font-size: 18px;
  }
  .ictech-section__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
  .ictech-about {
    margin: 8px 0 16px;
    padding: 20px 16px 16px;
  }
  .ictech-about__title {
    font-size: clamp(18px, 5vw, 24px);
  }
  .ictech-trust {
    padding: 0 12px 28px;
  }
  .ictech-trust__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .ictech-slider-wrap {
    grid-template-columns: 1fr !important;
    gap: 0;
  }
  .ictech-slider__side-btn {
    display: none !important;
  }
  .ictech-slider__title {
    font-size: clamp(20px, 6vw, 26px);
  }
  .ictech-slider__text {
    font-size: 14px;
    margin-bottom: 16px;
  }
  .ictech-slider__cta {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .ictech-home {
    padding: 0 10px 28px;
  }
  .ictech-trust__inner {
    grid-template-columns: 1fr 1fr !important;
  }
  .ictech-trust__card {
    padding: 16px 10px 14px;
  }
  .ictech-trust__label {
    font-size: 12px;
  }
}

/* =========================================================
   PRODUCT CARDS
   ========================================================= */
@media (max-width: 900px) {
  .ictech-card {
    padding: 10px;
  }
  .ictech-card__media {
    height: 110px;
  }
  .ictech-card__title {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }
  .ictech-card__cart,
  .ictech-card__cart--view {
    font-size: 12px;
    min-height: 40px;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

@media (max-width: 480px) {
  .ictech-card__media {
    height: 96px;
  }
  .ictech-card__brand {
    font-size: 10px;
  }
}

/* Prefer 2-col shop cards on phones (readable density) */
@media (max-width: 480px) {
  ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
  .ictech-section__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* =========================================================
   CATALOG / SHOP
   ========================================================= */
@media (max-width: 1100px) {
  body.ictech-catalog .ct-container,
  body.ictech-catalog .ct-container-full {
    padding-left: 14px;
    padding-right: 14px;
  }
  ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 999px) {
  body.ictech-catalog [data-sidebar] {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }

  /* Filters drawer */
  body.ictech-catalog aside#sidebar {
    display: block !important; /* override Blocksy ct-hidden-sm/md */
    position: fixed !important;
    z-index: 10060 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: -105% !important;
    right: auto !important;
    width: min(360px, 92vw) !important;
    max-width: 92vw !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 16px 14px 24px;
    background: #fff;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.2);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    transform: none !important;
    transition: none;
    order: 0;
    pointer-events: none;
  }
  body.ictech-catalog aside#sidebar.is-filters-open,
  body.ictech-catalog.ictech-filters-open aside#sidebar {
    left: 0 !important;
    pointer-events: auto;
  }
  body.ictech-catalog .ictech-filters-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10055;
    background: rgba(15, 23, 42, 0.45);
  }
  body.ictech-catalog.ictech-filters-open .ictech-filters-backdrop {
    display: block;
  }
  body.ictech-catalog.ictech-filters-open {
    overflow: hidden;
  }

  .ictech-filters-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    margin: 0 0 12px;
    border-radius: 999px;
    border: 1.5px solid var(--ictech-primary, #2937E9);
    background: #fff;
    color: var(--ictech-primary, #2937E9);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    max-width: 280px;
  }
  .ictech-filters-toggle:hover {
    background: #eef0ff;
  }
  .ictech-filters-close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
  }
  .ictech-filters-close strong {
    font-size: 16px;
    color: #0b1f3a;
  }
  .ictech-filters-close button {
    appearance: none;
    border: 0;
    background: #f1f5f9;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #0b1f3a;
  }

  body.ictech-catalog .woocommerce-result-count,
  body.ictech-catalog .woocommerce-ordering {
    float: none !important;
    width: 100%;
    margin: 0 0 10px;
  }
  body.ictech-catalog .woocommerce-ordering select {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
  }
  body.ictech-catalog .woocommerce-products-header,
  body.ictech-catalog .shop-results,
  body.ictech-catalog .woo-listing-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

@media (min-width: 1000px) {
  .ictech-filters-toggle,
  .ictech-filters-backdrop,
  .ictech-filters-close {
    display: none !important;
  }
}

@media (max-width: 760px) {
  ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
}

@media (max-width: 600px) {
  body.ictech-catalog .ct-container,
  body.ictech-catalog .ct-container-full {
    padding-left: 10px;
    padding-right: 10px;
  }
  .woocommerce-breadcrumb,
  .ct-breadcrumbs,
  nav.woocommerce-breadcrumb {
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
@media (max-width: 960px) {
  .ictech-footer__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px 20px;
    padding-top: 32px;
  }
  .ictech-footer__meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .ictech-footer__cols {
    grid-template-columns: 1fr !important;
    gap: 22px;
    padding: 28px 0 24px;
  }
  .ictech-footer__inner {
    padding: 0 14px;
  }
  .ictech-footer__contact-inner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding: 16px 14px;
  }
  .ictech-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .ictech-footer__bottom-links,
  .ictech-footer__pills {
    flex-wrap: wrap;
  }
  .ictech-footer__top {
    right: 12px;
    bottom: 12px;
  }
}

/* =========================================================
   CONTENT / ABOUT
   ========================================================= */
@media (max-width: 900px) {
  .ictech-page__wrap,
  .ictech-about-page__wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
  .ictech-page__hero,
  .ab-hero {
    padding-left: 16px;
    padding-right: 16px;
  }
  .ictech-page__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .ab-stats,
  .ab-values,
  .ab-quotes {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .ab-cta__actions,
  .ictech-page__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ab-cta__actions .ictech-btn,
  .ictech-page__actions .ictech-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .ictech-page__cards,
  .ab-stats,
  .ab-values,
  .ab-quotes,
  .ab-why {
    grid-template-columns: 1fr !important;
  }
  .ictech-page__title,
  .ab-hero__title {
    font-size: clamp(24px, 7vw, 32px);
  }
}

/* =========================================================
   WOO / CART / ACCOUNT
   ========================================================= */
@media (max-width: 760px) {
  body.woocommerce-cart .woocommerce,
  body.woocommerce-checkout .woocommerce,
  body.woocommerce-account .woocommerce {
    font-size: 15px;
  }
  body.woocommerce-cart table.shop_table,
  body.woocommerce-cart .cart_totals,
  body.woocommerce-checkout #order_review,
  body.woocommerce-checkout .col2-set .col-1,
  body.woocommerce-checkout .col2-set .col-2 {
    display: block;
    width: 100% !important;
    float: none !important;
  }
  .woocommerce-cart-form__contents {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .woocommerce form .form-row {
    width: 100% !important;
    float: none !important;
  }
}

/* =========================================================
   TOAST
   ========================================================= */
@media (max-width: 720px) {
  .ictech-cart-toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    transform: translateX(0) translateY(120%);
    max-width: none;
    width: auto;
  }
  .ictech-cart-toast.is-visible {
    transform: translateX(0) translateY(0);
  }
  .ictech-cart-toast__inner {
    font-size: 13px;
    padding: 12px;
  }
}
