/* ================= MOBILE HEADER ================= */

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 14px 16px !important;
    position: relative !important;
  }

  .logo {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding-right: 54px !important;
  }

  .logo img {
    width: 48px !important;
    height: 48px !important;
  }

  .company-name h1 {
    font-size: 18px !important;
    line-height: 1.15 !important;
  }

  .company-name p {
    display: none !important;
  }

  .menu-toggle {
    display: flex !important;
    position: absolute !important;
    top: 18px !important;
    right: 16px !important;
    width: 40px !important;
    height: 40px !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: white !important;
    font-size: 26px !important;
    padding: 0 !important;
    z-index: 20 !important;
  }

  .header-right {
    display: none !important;
    width: 100% !important;
    margin-top: 14px !important;
    padding-top: 14px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  }

  .header-right.active {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .header-right nav {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .header-right nav a {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 11px 8px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: white !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center !important;
  }

  .header-whatsapp {
    display: none !important;
  }

  /* ================= MODERN MOBILE HOMEPAGE ================= */

  .home-hero-v2 {
    padding: 38px 18px 28px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 28px !important;
  }

  .home-label {
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 12px !important;
  }

  .home-hero-text h1 {
    font-size: 35px !important;
    line-height: 1.08 !important;
    margin-bottom: 16px !important;
  }

  .home-hero-text p {
    font-size: 15px !important;
    line-height: 1.65 !important;
    margin-bottom: 20px !important;
  }

  .home-checklist {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-bottom: 22px !important;
  }

  .home-checklist li {
    font-size: 14px !important;
  }

  .home-checklist li::before {
    width: 20px !important;
    height: 20px !important;
    font-size: 12px !important;
  }

  .home-actions {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .home-actions a {
    width: 100% !important;
    text-align: center !important;
  }

  .home-hero-products {
    width: 100% !important;
    height: 310px !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 45px rgba(6, 38, 77, 0.12) !important;
  }

  .screw-one {
    width: 150px !important;
    left: 18px !important;
    bottom: 38px !important;
  }

  .screw-two {
    width: 90px !important;
    left: 105px !important;
    top: 72px !important;
  }

  .chem-one {
    width: 120px !important;
    right: 92px !important;
    top: 42px !important;
  }

  .chem-two {
    width: 98px !important;
    right: 28px !important;
    top: 72px !important;
  }

  .anchor-one {
    width: 90px !important;
    right: 35px !important;
    bottom: 48px !important;
  }

  .home-stats-v2 {
    margin: 0 16px 36px !important;
    padding: 18px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }

  .stat-card {
    padding: 0 !important;
    border-right: none !important;
    gap: 10px !important;
  }

  .stat-card svg {
    width: 28px !important;
    height: 28px !important;
  }

  .stat-card strong {
    font-size: 17px !important;
  }

  .stat-card span {
    font-size: 12px !important;
  }

  .home-shop,
  .home-why,
  .home-featured-products {
    padding: 0 16px !important;
    margin-bottom: 36px !important;
  }

  .home-section-title h2,
  .home-why h2 {
    font-size: 26px !important;
    line-height: 1.2 !important;
  }

  .home-section-title p {
    font-size: 14px !important;
  }

  .home-shop-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .home-shop-grid a {
    min-height: 160px !important;
    padding: 14px !important;
  }

  .home-shop-grid img {
    height: 80px !important;
  }

  .home-shop-grid span {
    font-size: 14px !important;
  }

  .home-why {
    margin: 0 16px 36px !important;
    padding: 24px !important;
    border-radius: 22px !important;
  }

  .home-why-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .why-card {
    padding: 18px !important;
    gap: 12px !important;
  }

  .why-card svg {
    width: 28px !important;
    height: 28px !important;
  }

  .why-card h3 {
    font-size: 17px !important;
  }

  .why-card p {
    font-size: 14px !important;
  }

  .home-title-row {
    display: block !important;
  }

  .home-title-row a {
    display: inline-block !important;
    margin-top: 8px !important;
  }

  .home-featured-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .home-featured-grid a {
    padding: 14px !important;
  }

  .home-featured-grid img {
    height: 90px !important;
  }

  .home-featured-grid h3 {
    font-size: 14px !important;
  }

  .home-bottom-cta {
    margin: 0 16px 40px !important;
    padding: 28px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    text-align: center !important;
    border-radius: 22px !important;
  }

  .home-bottom-cta h2 {
    font-size: 24px !important;
  }

  .home-bottom-cta a {
    width: 100% !important;
  }

  /* ================= PRODUCTS PAGE ================= */

  .products-page {
    padding: 38px 16px 60px !important;
  }

  .products-hero {
    text-align: left !important;
    margin-bottom: 28px !important;
  }

  .products-hero h1 {
    font-size: 34px !important;
  }

  .products-hero p {
    font-size: 15px !important;
  }

  .products-list .category-grid,
  .category-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  .products-list .category,
  .category {
    min-height: 170px !important;
    padding: 16px !important;
  }

  .products-list .category img,
  .category img {
    height: 75px !important;
    object-fit: contain !important;
  }

  .products-list .category p,
  .category p {
    font-size: 15px !important;
    text-align: center !important;
  }

  /* ================= CATALOG PAGE ================= */

  .catalog-page {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 18px 16px 40px !important;
    gap: 12px !important;
  }

  .catalog-content {
    width: 100% !important;
  }

  .breadcrumb {
    display: none !important;
  }

  .catalog-title,
  .section-header {
    margin-bottom: 18px !important;
  }

  .catalog-title h2,
  .catalog-intro h1,
  .section-header h2 {
    font-size: 28px !important;
    line-height: 1.15 !important;
  }

  .catalog-title p,
  .catalog-intro p,
  .section-header p {
    display: none !important;
  }

  /* ================= MOBILE SIDEBAR ================= */

  .sidebar {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .sidebar-toggle {
    width: 100% !important;
    padding: 13px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: white !important;
    color: var(--primary) !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
  }

  .toggle-icon {
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .toggle-icon svg {
    width: 18px !important;
    height: 18px !important;
    transition: transform 0.3s ease !important;
  }

  .sidebar.open .toggle-icon svg {
    transform: rotate(90deg);
  }

  .sidebar:not(.open) > *:not(.sidebar-toggle) {
    display: none !important;
  }

  .sidebar.open details,
  .sidebar.open .sidebar-main-link,
  .sidebar.open .sidebar-category-link {
    display: block !important;
    margin-top: 10px !important;
  }

  .sidebar details,
  .sidebar-main-link,
  .sidebar-category-link {
    background: white !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    margin-bottom: 8px !important;
  }

  .sidebar summary,
  .sidebar-main-link,
  .sidebar-category-link {
    padding: 12px 14px !important;
    font-size: 14px !important;
  }

  .sidebar-submenu a {
    font-size: 13px !important;
    padding: 10px 14px !important;
  }

  .sidebar-submenu a.active,
  .sidebar-main-link.active,
  .sidebar-category-link.active {
    background: var(--primary) !important;
    color: white !important;
  }

  .help-box {
    display: none !important;
  }

  /* ================= FASTENER CATEGORY CARDS ================= */

  .fastener-category-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .fastener-category-card {
    aspect-ratio: 1 / 1 !important;
    min-height: unset !important;
    padding: 12px !important;
    border-radius: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 12px !important;
  }

  .fastener-category-card img {
    width: 70px !important;
    height: 70px !important;
    object-fit: contain !important;
  }

  .fastener-category-card h3 {
    font-size: 15px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
  }

  .fastener-category-card p,
  .fastener-category-card .card-footer {
    display: none !important;
  }

  /* ================= PRODUCT CARDS ================= */

  .product-section {
    margin-bottom: 32px !important;
  }

  .product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .product-card {
    position: relative !important;
    height: 180px !important;
    min-height: 180px !important;
    padding: 14px 10px !important;
    border-radius: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 12px !important;
  }

  .product-card .card-image,
  .product-card .catalog-image,
  .product-card .product-image-container {
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .product-card img {
    width: 82px !important;
    height: 82px !important;
    object-fit: contain !important;
    margin: 0 !important;
  }

  .product-card h3 {
    font-size: 15px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
  }

  .product-card p,
  .product-card .product-options,
  .product-card .card-footer {
    display: none !important;
  }

  .product-colours {
    position: absolute !important;
    right: 14px !important;
    bottom: 14px !important;
    margin: 0 !important;
  }

  .product-colours small {
    display: none !important;
  }

  .color-dots {
    display: flex !important;
    gap: 5px !important;
  }

  .dot {
    width: 12px !important;
    height: 12px !important;
  }

  /* ================= CONTACT PAGE ================= */

  .contact-page {
    padding: 36px 16px 60px !important;
  }

  .contact-hero {
    text-align: left !important;
    margin-bottom: 28px !important;
  }

  .contact-hero h1 {
    font-size: 32px !important;
  }

  .contact-hero p {
    font-size: 15px !important;
  }

  .contact-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
  }

  .contact-info-card,
  .quote-card {
    padding: 22px !important;
    border-radius: 16px !important;
  }

  /* =============== PRODUCT DETAIL ================== */

  @media (max-width: 768px) {
    .product-detail {
      grid-template-columns: 1fr;
      padding: 24px;
    }

    .product-detail-info h1 {
      font-size: 28px;
    }
  }

  /* ================= FOOTER ================= */

  footer {
    width: 100% !important;
    padding: 24px 18px !important;
    text-align: center !important;
  }
}

/* ================= EXTRA SMALL PHONE ================= */

@media (max-width: 480px) {
  .home-hero-text h1 {
    font-size: 32px !important;
  }

  .home-hero-products {
    height: 290px !important;
  }

  .product-card {
    height: 175px !important;
    min-height: 175px !important;
  }

  .product-card img {
    width: 76px !important;
    height: 76px !important;
  }
}

/* ===== FINAL MOBILE FIXES: HOME 2x2, SHORT CARDS ===== */
@media (max-width: 768px) {
  header {
    z-index: 1000 !important;
  }
  .header-right {
    position: relative !important;
    z-index: 1001 !important;
  }

  .home-hero-v2 {
    text-align: center !important;
    align-items: center !important;
    padding: 44px 20px 30px !important;
  }
  .home-label {
    display: block !important;
    text-align: center !important;
  }
  .home-hero-text h1,
  .home-hero-text p {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .home-checklist {
    max-width: 320px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: left !important;
  }

  .home-stats-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    padding: 18px !important;
  }
  .stat-card {
    background: rgba(255, 255, 255, 0.55) !important;
    border: 1px solid #dce8f5 !important;
    border-radius: 16px !important;
    padding: 16px 12px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 115px !important;
  }
  .stat-card svg {
    width: 30px !important;
    height: 30px !important;
  }
  .stat-card strong {
    font-size: 18px !important;
    margin: 0 0 4px !important;
  }
  .stat-card span {
    font-size: 13px !important;
    line-height: 1.3 !important;
  }

  .home-why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  .why-card {
    min-height: 150px !important;
    padding: 16px 12px !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .why-card svg,
  .why-card i {
    width: 30px !important;
    height: 30px !important;
    margin: 0 auto !important;
  }
  .why-card h3 {
    font-size: 16px !important;
    line-height: 1.2 !important;
  }
  .why-card p {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .product-card {
    height: 170px !important;
    min-height: 170px !important;
    padding: 14px 10px !important;
    overflow: hidden !important;
  }
  .product-card .catalog-image,
  .product-card .card-image,
  .product-card .product-image-container {
    height: auto !important;
    width: 100% !important;
  }
  .product-card img {
    width: 78px !important;
    height: 78px !important;
    max-height: 78px !important;
  }
  .product-card h3 {
    font-size: 14px !important;
    line-height: 1.2 !important;
    max-width: 100% !important;
  }
  .product-card p,
  .product-card .product-meta,
  .product-card .product-origin,
  .product-card .product-options,
  .product-card .product-colours,
  .product-card .card-footer {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .product-card {
    height: 160px !important;
    min-height: 160px !important;
  }
  .product-card img {
    width: 72px !important;
    height: 72px !important;
    max-height: 72px !important;
  }
}

/* ===== V4 ROLLBACK PATCH: MOBILE ALIGNMENT + CLEAN CARDS ===== */
@media (max-width: 768px) {
  /* center mobile section headings/content */
  .products-hero,
  .catalog-title,
  .catalog-intro,
  .section-header,
  .home-section-title,
  .home-title-row,
  .home-why h2 {
    text-align: center !important;
  }

  .products-hero h1,
  .products-hero p,
  .catalog-title h2,
  .catalog-title p,
  .catalog-intro h1,
  .catalog-intro p,
  .section-header h2,
  .section-header p,
  .home-section-title h2,
  .home-section-title p,
  .home-why h2 {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* home shop category cards: middle image + name */
  .home-shop-grid a {
    min-height: 190px !important;
    padding: 18px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 16px !important;
  }

  .home-shop-grid img {
    width: 105px !important;
    height: 105px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }

  .home-shop-grid span {
    font-size: 17px !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }

  /* why choose: only icon + topic */
  .home-why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  .why-card {
    min-height: 135px !important;
    padding: 18px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 12px !important;
  }

  .why-card > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .why-card svg,
  .why-card i {
    width: 34px !important;
    height: 34px !important;
    margin: 0 auto !important;
  }

  .why-card h3 {
    font-size: 17px !important;
    line-height: 1.15 !important;
    margin: 0 !important;
    text-align: center !important;
  }

  .why-card p {
    display: none !important;
  }

  /* featured products: centered, no View Details */
  .home-featured-grid a {
    min-height: 190px !important;
    padding: 18px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 14px !important;
  }

  .home-featured-grid img {
    width: 105px !important;
    height: 105px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }

  .home-featured-grid h3 {
    font-size: 16px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    text-align: center !important;
  }

  .home-featured-grid span {
    display: none !important;
  }

  /* fastener/category cards: bigger image and name */
  .fastener-category-card {
    min-height: unset !important;
    aspect-ratio: 1 / 1 !important;
    padding: 14px !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    gap: 16px !important;
  }

  .fastener-category-card img {
    width: 105px !important;
    height: 105px !important;
    object-fit: contain !important;
  }

  .fastener-category-card h3 {
    font-size: 18px !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }
}

@media (max-width: 480px) {
  .home-shop-grid img,
  .home-featured-grid img,
  .fastener-category-card img {
    width: 92px !important;
    height: 92px !important;
  }

  .home-shop-grid span,
  .fastener-category-card h3 {
    font-size: 16px !important;
  }
}

/* ================= FINAL V7 MOBILE POLISH ================= */
@media (max-width: 768px) {
  /* Products page category cards: image + name only */
  .products-page .products-list .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  .products-page .products-list .category-card {
    min-height: unset !important;
    aspect-ratio: 1 / 1 !important;
    padding: 14px !important;
    border-radius: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 16px !important;
  }

  .products-page .products-list .category-image {
    height: auto !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .products-page .products-list .category-image img {
    width: 105px !important;
    height: 105px !important;
    max-width: 105px !important;
    max-height: 105px !important;
    object-fit: contain !important;
  }

  .products-page .products-list .category-info {
    flex: unset !important;
  }

  .products-page .products-list .category-info h3 {
    font-size: 18px !important;
    line-height: 1.18 !important;
    margin: 0 !important;
    text-align: center !important;
  }

  .products-page .products-list .category-info p,
  .products-page .products-list .category-footer {
    display: none !important;
  }

  /* Category pages: slightly larger image and name */
  .fastener-category-card {
    gap: 18px !important;
  }

  .fastener-category-card img {
    width: 118px !important;
    height: 118px !important;
    max-width: 118px !important;
    max-height: 118px !important;
  }

  .fastener-category-card h3 {
    font-size: 19px !important;
    line-height: 1.18 !important;
  }
}

@media (max-width: 480px) {
  .products-page .products-list .category-card {
    padding: 12px !important;
    gap: 14px !important;
  }

  .products-page .products-list .category-image img,
  .fastener-category-card img {
    width: 100px !important;
    height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
  }

  .products-page .products-list .category-info h3,
  .fastener-category-card h3 {
    font-size: 17px !important;
  }
}

@media (max-width: 768px) {
  /* Keep category navigation collapsed until the user opens it. */
  .sidebar:not(.open) #sidebarCategories,
  .sidebar:not(.open) .help-box {
    display: none !important;
  }

  .sidebar.open #sidebarCategories {
    display: block !important;
    padding-top: 2px !important;
  }

  .sidebar-back-link {
    padding: 12px 14px !important;
    margin: 9px 0 0 !important;
    border-radius: 12px !important;
    font-size: 14px !important;
  }

  .sidebar-section-label {
    margin: 16px 2px 7px !important;
    font-size: 11px !important;
  }

  .sidebar-switcher {
    display: block !important;
    margin-top: 14px !important;
  }

  .sidebar-switcher summary {
    padding: 12px 14px !important;
    font-size: 14px !important;
  }

  .sidebar-category-link-compact {
    padding: 10px 12px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 768px) {
  /* Cross-category access is shown only inside the mobile Screws menu. */
  .mobile-product-switcher {
    display: block !important;
    margin-top: 12px !important;
  }

  .product-nav-arrow {
    width: 40px !important;
    height: 40px !important;
    font-size: 30px !important;
    opacity: 0.9;
  }

  .product-nav-previous {
    left: 10px !important;
  }

  .product-nav-next {
    right: 10px !important;
  }

  .product-position {
    right: 12px !important;
    bottom: 10px !important;
  }

  .product-detail-image-box::after {
    content: "Swipe to browse";
    position: absolute;
    left: 50%;
    bottom: 11px;
    transform: translateX(-50%);
    color: #728198;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
  }
}

/* ================= V11 MOBILE NAVIGATION POLISH ================= */
@media (max-width: 768px) {
  /* Only show a simple return path while browsing screw subcategories. */
  .mobile-product-switcher,
  .sidebar-switcher {
    display: none !important;
  }

  .mobile-screw-overview-back {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    margin: 10px 0 12px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: white !important;
    color: var(--primary) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 800 !important;
  }

  .mobile-screw-overview-back:active {
    background: #eef4ff !important;
  }

  /* Arrows control the whole product page and float at the screen edges. */
  .product-nav-arrow {
    position: fixed !important;
    top: 50% !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 31px !important;
    z-index: 1200 !important;
    opacity: 0.94 !important;
  }

  .product-nav-previous {
    left: 8px !important;
  }

  .product-nav-next {
    right: 8px !important;
  }

  .product-position {
    top: 12px !important;
    right: 16px !important;
    bottom: auto !important;
  }

  .product-detail-image-box::after {
    content: none !important;
  }

  .product-detail-page::after {
    content: "Swipe anywhere to browse";
    display: block;
    text-align: center;
    margin: -22px 0 24px;
    color: #728198;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
  }
}

@media (min-width: 769px) {
  .mobile-screw-overview-back {
    display: none !important;
  }
}

/* Hardware & Tools > Power Tool Accessories: flat mobile navigation. */
.mobile-power-accessory-navigation {
  display: none;
}

@media (max-width: 768px) {
  .desktop-power-accessory-navigation {
    display: none !important;
  }

  .mobile-power-accessory-navigation {
    display: block !important;
    margin-top: 10px !important;
  }

  .mobile-accessory-parent-link {
    box-sizing: border-box !important;
    min-height: 48px !important;
    margin: 0 0 10px !important;
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: white !important;
    color: var(--primary) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 800 !important;
  }

  .mobile-accessory-parent-link > span:first-child {
    font-size: 17px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    opacity: 0.82 !important;
  }

  .mobile-accessory-subcategory-list {
    box-sizing: border-box !important;
    padding: 8px !important;
    display: grid !important;
    gap: 4px !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: white !important;
  }

  .mobile-accessory-subcategory-link {
    box-sizing: border-box !important;
    min-height: 44px !important;
    padding: 11px 13px !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 9px !important;
    color: #4d5d70 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
  }

  .mobile-accessory-subcategory-link.active {
    background: var(--primary) !important;
    color: white !important;
  }

  .mobile-accessory-parent-link:active,
  .mobile-accessory-subcategory-link:not(.active):active {
    background: #eef4ff !important;
  }
}

/* ================= V12 MOBILE PRODUCT NAV + ABOUT BUTTONS ================= */
@media (max-width: 768px) {
  .product-detail-topbar {
    width: calc(100% - 32px) !important;
    margin: 18px auto 4px !important;
  }

  .product-back-link {
    min-height: 40px !important;
    padding: 9px 13px !important;
    border-radius: 11px !important;
    font-size: 13px !important;
  }

  .product-position {
    position: static !important;
    margin-left: auto !important;
    background: transparent !important;
    color: var(--primary) !important;
    padding: 0 !important;
    font-size: 13px !important;
  }

  .product-detail-topbar:has(+ .product-nav-arrow) {
    justify-content: space-between;
  }

  .product-nav-arrow::before {
    width: 9px !important;
    height: 9px !important;
    border-width: 2.5px 2.5px 0 0 !important;
  }

  .about-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: 24px !important;
  }

  .about-primary-btn,
  .about-secondary-btn {
    min-width: 0 !important;
    min-height: 50px !important;
    padding: 12px 10px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 360px) {
  .about-actions {
    grid-template-columns: 1fr !important;
  }
}

/* ================= V13 MOBILE PRODUCT TOPBAR ================= */
@media (max-width: 768px) {
  .product-detail-topbar {
    width: calc(100% - 32px) !important;
    margin: 18px auto 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .product-back-link {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 20px !important;
  }

  .product-position {
    position: static !important;
    display: inline-flex !important;
    width: auto !important;
    min-width: 44px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: rgba(6, 38, 77, 0.86) !important;
    color: #fff !important;
    font-size: 13px !important;
    line-height: 1 !important;
  }

  .product-position[hidden] {
    display: none !important;
  }
}

/* ================= V14 MOBILE PRODUCT TOPBAR + HERO ================= */
@media (max-width: 768px) {
  .product-detail-page {
    padding-top: 18px !important;
  }

  .product-detail-topbar {
    width: calc(100% - 40px) !important;
    margin: 0 auto 24px !important;
    padding: 0 !important;
  }

  .home-hero-v2 {
    width: calc(100% - 28px) !important;
    margin: 18px auto 34px !important;
    padding: 34px 20px 22px !important;
    border-radius: 26px !important;
    gap: 24px !important;
    text-align: center !important;
  }

  .home-label {
    display: inline-flex !important;
    margin: 0 auto 16px !important;
    padding: 7px 10px !important;
    font-size: 10px !important;
  }

  .home-hero-text h1 {
    color: #fff !important;
    font-size: 35px !important;
    line-height: 1.06 !important;
    max-width: 330px !important;
    margin: 0 auto 16px !important;
  }

  .home-hero-text p {
    color: rgba(255, 255, 255, 0.78) !important;
    max-width: 340px !important;
    margin: 0 auto 20px !important;
  }

  .home-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    max-width: 350px !important;
    margin: 0 auto 22px !important;
  }

  .home-checklist li {
    justify-content: flex-start !important;
    min-height: 56px !important;
    padding: 9px 10px !important;
    text-align: left !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    border-radius: 12px !important;
  }

  .home-checklist li::before {
    width: 18px !important;
    height: 18px !important;
    margin-right: 7px !important;
  }

  .home-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 9px !important;
    width: 100% !important;
  }

  .home-actions .hero-btn,
  .home-actions .whatsapp-outline-btn {
    width: 100% !important;
    min-height: 48px !important;
    padding: 11px 8px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .home-hero-products {
    height: 270px !important;
    border-radius: 20px !important;
  }
}

@media (max-width: 360px) {
  .home-checklist,
  .home-actions {
    grid-template-columns: 1fr !important;
  }
}

/* ================= V15 MOBILE PRODUCT NAVIGATION BAR ================= */
@media (max-width: 768px) {
  .product-detail-page {
    padding-top: 16px !important;
  }

  .product-detail-topbar {
    width: calc(100% - 28px) !important;
    min-height: 52px !important;
    margin: 0 auto 12px !important;
    padding: 6px 8px !important;
    border-radius: 14px !important;
    background: #fff !important;
    border: 1px solid #e2eaf3 !important;
    box-shadow: 0 6px 18px rgba(6, 38, 77, 0.05) !important;
  }

  .product-back-link {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 11px !important;
  }

  .product-position {
    position: static !important;
    inset: auto !important;
    min-width: 48px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    background: #eaf1fa !important;
    color: var(--primary) !important;
    font-size: 12px !important;
    writing-mode: horizontal-tb !important;
    transform: none !important;
  }
}

/* ================= V16 MOBILE FLOATING PRODUCT NAV ================= */
@media (max-width: 768px) {
  .product-detail-page {
    padding-top: 18px !important;
  }

  .product-detail-topbar {
    width: calc(100% - 40px) !important;
    min-height: 40px !important;
    margin: 0 auto 16px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .product-back-link {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid #d8e3ef !important;
    box-shadow: 0 7px 18px rgba(6, 38, 77, 0.08) !important;
  }

  .product-position {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    min-width: 46px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: rgba(6, 38, 77, 0.9) !important;
    color: #fff !important;
    box-shadow: 0 7px 18px rgba(6, 38, 77, 0.1) !important;
    font-size: 12px !important;
    line-height: 1 !important;
    writing-mode: horizontal-tb !important;
    transform: none !important;
  }
}

/* ================= V17 MOBILE OPTION D ================= */
@media (max-width: 768px) {
  .product-detail-page {
    padding-top: 14px !important;
  }

  .product-detail-topbar {
    width: calc(100% - 40px) !important;
    min-height: 38px !important;
    margin: 0 auto 10px !important;
    padding: 0 !important;
    justify-content: flex-start !important;
  }

  .product-detail-image-box {
    position: relative !important;
    overflow: visible !important;
  }

  .product-detail-image-box .product-position {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    min-width: 46px !important;
    height: 30px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    background: rgba(6, 38, 77, 0.9) !important;
    color: #fff !important;
    box-shadow: 0 7px 18px rgba(6, 38, 77, 0.14) !important;
  }
}

/* ================= V18 MOBILE PILL BACK + GLASS COUNTER ================= */
@media (max-width: 768px) {
  .product-detail-topbar {
    width: calc(100% - 40px) !important;
    min-height: 40px !important;
    margin: 0 auto 12px !important;
    padding: 0 !important;
  }

  .product-back-link {
    width: auto !important;
    height: 40px !important;
    min-width: 0 !important;
    min-height: 40px !important;
    padding: 0 15px 0 13px !important;
    gap: 7px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
  }

  .product-back-link .product-back-text {
    display: inline !important;
  }

  .product-detail-image-box .product-position {
    top: 12px !important;
    right: 12px !important;
    min-width: 44px !important;
    height: 29px !important;
    padding: 0 9px !important;
    background: rgba(255, 255, 255, 0.72) !important;
    color: rgba(6, 38, 77, 0.82) !important;
    border: 1px solid rgba(6, 38, 77, 0.09) !important;
    box-shadow: 0 6px 16px rgba(16, 40, 74, 0.08) !important;
    font-size: 11px !important;
  }
}

/* ================= V21 FINAL MOBILE ALIGNMENT ================= */
@media (max-width: 768px) {
  .contact-page {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .contact-layout {
    width: 100% !important;
    align-items: center !important;
  }

  .contact-info-card,
  .quote-card {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  .product-detail-page {
    padding-top: 0 !important;
  }

  .product-detail-topbar {
    width: calc(100% - 56px) !important;
    margin: 24px auto 20px !important;
    min-height: 42px !important;
    display: flex !important;
    align-items: center !important;
  }

  .home-hero-products {
    height: 280px !important;
    padding: 0 !important;
  }

  .home-hero-collage {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 58% center !important;
  }
}

/* Screw sidebar: hide single-page arrows on mobile only */
@media (max-width: 768px) {
  .mobile-hide-single-arrow {
    display: none !important;
  }
}

/* Smooth Categories icon rotation */
@media (max-width: 768px) {
  .sidebar-toggle .toggle-icon {
    transform: rotate(0deg);
    transform-origin: center center;
    transition: transform 0.3s ease !important;
    will-change: transform;
  }

  .sidebar.open .sidebar-toggle .toggle-icon {
    transform: rotate(90deg);
  }
}

/* ===== MOBILE SCREW SIDEBAR POLISH ===== */
@media (max-width: 768px) {
  /* Softer back mark. */
  .mobile-screw-overview-back .mobile-back-chevron {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    opacity: 0.82 !important;
  }

  /* Keep the four screw navigation rows visually identical. */
  .sidebar details > summary,
  .sidebar .sidebar-main-link {
    min-height: 50px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
  }

  /* Chipboard and Drywall stay arrow-free on mobile. */
  .mobile-hide-single-arrow {
    display: none !important;
  }
}

/* =========================================================
   CLEAN MOBILE POWER-TOOL PRODUCT CARDS
   ========================================================= */
@media (max-width: 768px) {
  .product-section .product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  .product-section .product-grid .catalog-card.product-card {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 248px !important;
    min-height: 248px !important;
    max-height: 248px !important;
    margin: 0 !important;
    padding: 10px 9px 12px !important;
    display: grid !important;
    grid-template-rows: 174px 52px !important;
    gap: 0 !important;
    align-content: start !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }
  .product-section .product-grid .catalog-card.product-card .catalog-image {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 174px !important;
    min-height: 174px !important;
    margin: 0 !important;
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }
  .product-section .product-grid .catalog-card.product-card .catalog-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 176px !important;
    max-height: 158px !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: auto !important;
    display: block !important;
  }
  .product-section .product-grid .catalog-card.product-card h3 {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 5px 2px 0 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
    text-align: center !important;
    font-size: 13.5px !important;
    line-height: 1.18 !important;
  }
  .product-section .product-grid .catalog-card.product-card > p,
  .product-section .product-grid .catalog-card.product-card .product-meta,
  .product-section .product-grid .catalog-card.product-card .card-footer { display:none !important; }
  .product-section .product-grid .catalog-card.catalogue-card-featured .catalog-image { padding:17px !important; }
  .product-section .product-grid .catalog-card.catalogue-card-featured .catalog-image img {
    width:auto !important; height:138px !important; max-width:100% !important; max-height:138px !important;
  }
}

/* ================= TRUSTED BRANDS MOBILE ================= */
@media (max-width: 768px) {
  .home-brands {
    margin: 0 16px 44px !important;
    padding: 30px 18px 24px !important;
    border-radius: 22px !important;
  }
  .home-brands-heading {
    display: block !important;
    text-align: center !important;
    margin-bottom: 22px !important;
  }
  .home-brands-heading p {
    margin: 8px auto 0 !important;
    font-size: 14px !important;
  }
  .brands-assurance {
    display: inline-block !important;
    margin-top: 14px !important;
    font-size: 11px !important;
    padding: 8px 12px !important;
  }
  .home-brands-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .brand-card {
    min-height: 92px !important;
    padding: 13px !important;
    border-radius: 14px !important;
  }
  .brand-card img { height: 54px !important; }
}

/* ================= IMPLEMENTATION QA POLISH ================= */
@media (max-width: 768px) {
  .product-section .product-grid {
    grid-auto-rows: 1fr !important;
  }

  .product-section .product-grid .catalog-card.product-card {
    min-width: 0 !important;
    height: 248px !important;
    min-height: 248px !important;
    max-height: 248px !important;
  }

  .product-section .product-grid .catalog-card.product-card .catalog-image {
    aspect-ratio: auto !important;
    background-position: center !important;
  }

  .product-section .product-grid .catalog-card.product-card h3 {
    overflow-wrap: anywhere !important;
  }
}
@media (max-width: 390px) {
  .brand-card { min-height: 84px !important; }
  .brand-card img { height: 48px !important; }
}

/* Final mobile override: simple visible < Back button */
@media (max-width: 768px) {
  .product-detail-topbar .product-back-link {
    box-sizing: border-box !important;
    min-width: 102px !important;
    width: auto !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 17px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    border: 1px solid #cbd8e7 !important;
    border-radius: 11px !important;
    background: #fff !important;
    color: #123b6d !important;
    box-shadow: 0 6px 16px rgba(17, 52, 91, .08) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }

  .product-detail-topbar .product-back-link::before {
    content: "" !important;
    width: 8px !important;
    height: 8px !important;
    border-left: 2px solid currentColor !important;
    border-bottom: 2px solid currentColor !important;
    transform: rotate(45deg) !important;
    margin-left: 2px !important;
  }

  .product-detail-topbar .product-back-link::after { content: none !important; }
  .product-detail-topbar .product-back-link .product-back-text {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    transform: none !important;
  }
}

/* =========================================================
   v3.3.3 — MOBILE TOP-LEVEL PAGE HERO REMOVAL
   Products, Projects, About and Contact only.
   Desktop heroes are unchanged.
   ========================================================= */
@media (max-width: 768px) {
  .products-hero.page-hero,
  .projects-hero.page-hero,
  .about-page-hero.page-hero,
  .contact-hero.page-hero {
    display: none !important;
  }

  .products-page,
  .projects-page,
  .about-page,
  .contact-page {
    padding-top: 22px !important;
  }

  .products-list,
  .projects-list,
  .contact-layout,
  .about-hero-bento {
    margin-top: 0 !important;
  }
}

/* Mobile header: a compact disclosure menu above the page, without layout shifts. */
@media (max-width: 768px) {
  header.site-header, .site-header { min-height: 0 !important; height: auto !important; padding: 0 !important; }
  .site-header .site-header-inner { width: 100% !important; min-height: 0 !important; padding: 12px 14px !important; gap: 0 !important; }
  .site-header .logo { width: calc(100% - 56px) !important; min-height: 46px !important; margin: 0 !important; padding: 0 !important; gap: 10px !important; }
  .site-header .logo img { width: 46px !important; height: 46px !important; flex: 0 0 46px !important; }
  .site-header .company-name h1 { font-size: clamp(16px, 4.7vw, 18px) !important; line-height: 1.12 !important; }
  .site-header .menu-toggle { top: 13px !important; right: 14px !important; width: 44px !important; height: 44px !important; padding: 0 !important; border: 1px solid rgba(255,255,255,.25) !important; border-radius: 9px !important; background: rgba(255,255,255,.06) !important; box-shadow: none !important; color: #fff !important; cursor: pointer !important; }
  .site-header .menu-toggle:hover, .site-header .menu-toggle[aria-expanded="true"] { background: rgba(255,255,255,.13) !important; border-color: rgba(255,255,255,.4) !important; }
  .site-header .menu-toggle:focus-visible { outline: 3px solid #9bc8f1 !important; outline-offset: 3px !important; }
  .menu-icon { display: block; position: relative; width: 21px; height: 18px; }
  .menu-icon > span { position: absolute; left: 0; display: block; width: 21px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 160ms ease, opacity 160ms ease; }
  .menu-icon > span:nth-child(1) { top: 1px; }
  .menu-icon > span:nth-child(2) { top: 8px; }
  .menu-icon > span:nth-child(3) { top: 15px; }
  .menu-toggle[aria-expanded="true"] .menu-icon > span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-icon > span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] .menu-icon > span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-header .header-right, .site-header .header-right.active { position: absolute !important; top: calc(100% + 8px) !important; left: 12px !important; right: 12px !important; width: auto !important; min-height: 0 !important; height: auto !important; max-height: calc(100dvh - 96px) !important; margin: 0 !important; padding: 8px !important; gap: 8px !important; border: 1px solid #dce6f0 !important; border-radius: 12px !important; background: #fff !important; box-shadow: 0 12px 36px rgba(6,26,48,.17) !important; overflow-y: auto; overscroll-behavior: contain; }
  .site-header .header-right.active { animation: mobile-menu-in 160ms ease-out both; }
  .site-header .header-right nav { display: flex !important; flex-direction: column !important; align-items: stretch !important; width: 100% !important; gap: 2px !important; }
  .site-header .header-right nav a { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 12px !important; box-sizing: border-box !important; width: 100% !important; min-width: 0 !important; min-height: 44px !important; margin: 0 !important; padding: 12px 14px !important; border: 1px solid transparent !important; border-radius: 7px !important; background: transparent !important; color: #34536f !important; box-shadow: none !important; font-size: 14px !important; font-weight: 600 !important; line-height: 1.4 !important; text-align: left !important; text-decoration: none !important; transform: none !important; }
  .site-header .header-right nav a::after { content: "" !important; position: static !important; display: block !important; flex: 0 0 6px; width: 6px !important; height: 6px !important; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; background: transparent !important; opacity: .55; transform: rotate(-45deg) !important; }
  .site-header .header-right nav a:hover { background: #f4f7fa !important; }
  .site-header .header-right nav a:focus-visible { outline: 3px solid #2674ae !important; outline-offset: -2px !important; }
  .site-header .header-right nav a.active { background: #edf3f9 !important; color: #123f73 !important; box-shadow: inset 3px 0 #20a563 !important; }
  .site-header .header-right nav a:last-child { margin-top: 5px !important; border-top-color: #e5ebf1 !important; color: #167243 !important; }
}

@keyframes mobile-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .site-header .header-right.active {
    animation: none !important;
  }

  .site-header .menu-toggle, .menu-icon > span {
    transition: none !important;
  }
}

/* Shared header finish. Keep this after the existing shared mobile styles. */
.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 10001;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #cbd9e7;
  border-radius: 8px;
  background: #fff;
  color: #123f73;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(calc(-100% - 20px));
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #2674ae;
  outline-offset: 3px;
}

.site-header {
  background: #0b294b;
  border-bottom: 1px solid rgba(203, 220, 237, 0.12);
}

.site-header .site-header-inner {
  width: calc(100% - 64px);
  max-width: none;
  min-height: 84px;
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-header .logo {
  flex: 0 0 auto;
  min-width: 0;
  gap: 12px;
  text-decoration: none;
}

.site-header .logo img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: contain;
}

.site-header .company-name {
  display: flex !important;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.site-header .company-title {
  display: block;
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.site-header .company-tagline {
  display: block;
  color: #b7c9dc;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-header .header-right {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header .header-right nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header .header-right nav a {
  min-height: 44px;
  padding: 8px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 5px;
  color: #cfdbeb;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
  transform: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.site-header .header-right nav a:hover,
.site-header .header-right nav a.active,
.site-header .header-right nav a[aria-current] {
  color: #fff;
  transform: none;
}

.site-header a:focus-visible,
.site-header .menu-toggle:focus-visible {
  outline: 3px solid #94c9ef;
  outline-offset: 4px;
}

.site-header .header-right nav a.nav-contact {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid #168553;
  border-radius: 8px;
  background: #168553;
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.site-header .header-right nav a.nav-contact:hover,
.site-header .header-right nav a.nav-contact.active,
.site-header .header-right nav a.nav-contact[aria-current] {
  border-color: #107347;
  background: #107347;
  color: #fff;
}

.site-header .header-right nav a.nav-contact::after {
  display: none !important;
  content: none !important;
}

.site-header .header-contact-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

@media (min-width: 769px) {
  .site-header .company-title {
    font-size: 20px;
    font-weight: 600;
  }

  .site-header .header-right nav a {
    font-weight: 400;
  }

  .site-header .header-right nav a.nav-contact {
    border-color: rgba(100, 204, 156, 0.52);
    background: rgba(43, 199, 126, 0.08);
    color: #c9ebd9;
    font-weight: 500;
  }

  .site-header .header-right nav a.nav-contact:hover,
  .site-header .header-right nav a.nav-contact.active,
  .site-header .header-right nav a.nav-contact[aria-current] {
    border-color: #6acb9b;
    background: rgba(43, 199, 126, 0.18);
    color: #fff;
  }

  .site-header .header-right nav a:not(.nav-contact)::after {
    position: absolute;
    right: 4px;
    bottom: 3px;
    left: 4px;
    width: auto;
    height: 2px;
    border: 0;
    border-radius: 2px;
    background: #2bc77e;
    opacity: 0;
    transform: none;
    transition: opacity 160ms ease;
  }

  .site-header .header-right nav a:not(.nav-contact):hover::after,
  .site-header .header-right nav a:not(.nav-contact).active::after,
  .site-header .header-right nav a:not(.nav-contact)[aria-current]::after {
    width: auto;
    opacity: 1;
  }
}

/* Give navigation a full row before the desktop layout becomes cramped. */
@media (min-width: 769px) and (max-width: 1279px) {
  .site-header .site-header-inner {
    width: calc(100% - 64px);
    min-height: 0;
    padding: 12px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 8px 20px;
  }

  .site-header .logo {
    grid-column: 1;
    grid-row: 1;
  }

  .site-header .logo img {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .site-header .company-title {
    font-size: 20px;
  }

  .site-header .header-right {
    display: contents;
  }

  .site-header .header-right nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .site-header .site-header-inner {
    position: relative;
    width: 100% !important;
    min-height: 68px !important;
    padding: 12px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  .site-header .logo {
    width: calc(100% - 56px) !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 10px !important;
  }

  .site-header .logo img {
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px !important;
  }

  .site-header .company-title {
    font-size: clamp(15.5px, 4.2vw, 18px);
    line-height: 1.25;
  }

  .site-header .company-tagline {
    display: none;
  }

  .site-header .menu-toggle {
    top: 12px !important;
    right: 14px !important;
    width: 44px !important;
    height: 44px !important;
    border: 1px solid rgba(203, 220, 237, 0.28) !important;
    border-radius: 9px !important;
    background: rgba(255, 255, 255, 0.05) !important;
  }

  .site-header .menu-toggle:hover,
  .site-header .menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.12) !important;
  }

  .site-header .header-right,
  .site-header .header-right.active {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-height: calc(100dvh - 88px) !important;
    margin: 0 !important;
    padding: 8px !important;
    gap: 8px !important;
    border: 1px solid #dce6f0 !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 14px 35px rgba(11, 41, 75, 0.16) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  .site-header .header-right:not(.active) {
    display: none !important;
  }

  .site-header .header-right.active {
    display: flex !important;
    flex-direction: column !important;
  }

  .site-header .header-right nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 3px !important;
  }

  .site-header .header-right nav a {
    min-height: 44px !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
  }

  .site-header .header-right nav a:not(.nav-contact).active,
  .site-header .header-right nav a:not(.nav-contact)[aria-current] {
    background: #edf3f9 !important;
    color: #123f73 !important;
    box-shadow: inset 3px 0 0 #2bc77e !important;
  }

  .site-header .header-right nav a.nav-contact {
    justify-content: space-between !important;
    margin-top: 6px !important;
    border: 1px solid #168553 !important;
    border-radius: 8px !important;
    background: #168553 !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: none !important;
  }

  .site-header .header-right nav a.nav-contact:hover,
  .site-header .header-right nav a.nav-contact.active,
  .site-header .header-right nav a.nav-contact[aria-current] {
    border-color: #107347 !important;
    background: #107347 !important;
    color: #fff !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .header-right nav a,
  .site-header .header-right nav a::after {
    transition: none;
  }
}

/* Use the available desktop width, with each page controlling its inner layout.
   Scoped container rules override legacy page caps while preserving mobile. */
@media (min-width: 769px) {
  body.home-screen > main.home-hub,
  body.catalogue-page > main.products-page,
  body.category-browser-screen > main.category-browser,
  body.product-detail-screen > main.product-detail-page,
  body.trade-landing > main.trade-page,
  body.company-profile > main.company-page,
  body.calculator-site > main.calculator-page,
  body.contact-screen > main.contact-hub {
    width: calc(100% - 64px) !important;
    max-width: none !important;
    min-width: 0;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }

  /* Match the centered homepage width on the reading pages. */
  body.home-screen > main.home-hub,
  body.product-detail-screen > main.product-detail-page,
  body.company-profile > main.company-page {
    width: min(1440px, calc(100% - 64px)) !important;
  }

  /* Guide backgrounds span the screen; their shared content shell sets the gutter. */
  body > main.roofing-page > .roofing-shell {
    width: calc(100% - 64px);
    max-width: none;
  }

  body.company-profile .company-hero-media {
    width: 100%;
    max-width: 720px;
    justify-self: end;
  }
}

/* Let the homepage fill QHD monitors while keeping reading pages bounded. */
@media (min-width: 2000px) {
  body.home-screen > main.home-hub {
    width: calc(100% - 64px) !important;
  }
}

/* The PDF viewer changes to its mobile layout at 800px. */
@media (min-width: 801px) {
  body > main.catalogue-viewer-page {
    padding-inline: 32px;
  }
}

/* Add columns as space grows, retaining comfortable product-card widths. */
@media (min-width: 1600px) {
  body.category-browser-screen .browse-group-grid,
  body.category-browser-screen #categoryProducts .product-grid,
  body > main.roofing-page .roofing-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (min-width: 1800px) {
  body.catalogue-page .products-list .category-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
