/* JaBe Originals – mobile overrides
   Desktop layout stays untouched. Rules apply only <= 900px. */

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

  /* shared storefront header */
  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) .topbar {
    height: auto !important;
    min-height: 34px;
    padding: 8px 14px !important;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center !important;
    text-align: center;
    line-height: 1.45;
  }

  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) header {
    height: auto !important;
    min-height: 0;
    padding: 14px 16px 16px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas: "logo" "left" "right";
    gap: 12px;
    justify-items: center;
  }
  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) header .logo {
    grid-area: logo;
    width: auto !important;
  }
  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) header .logo img {
    width: 150px !important;
    height: auto !important;
    max-height: 62px;
    object-fit: contain;
  }
  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) header nav:first-of-type,
  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) header .nav-left {
    grid-area: left;
  }
  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) header .nav-right {
    grid-area: right;
  }
  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) header nav {
    width: 100%;
    justify-content: center !important;
    gap: 10px 18px !important;
    flex-wrap: wrap;
  }
  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) header nav a {
    font-size: 10px !important;
    letter-spacing: 1.2px !important;
  }

  footer { padding: 24px 16px !important; line-height: 1.8; }

  /* Home */
  .page-index .hero {
    height: auto !important;
    min-height: 430px;
    padding: 65px 22px !important;
    background-position: 70% center !important;
  }

  .page-index .hero-fade-layer {
    background-position: 70% center !important;
}

@media (orientation: portrait) {
    .page-index .hero,
    .page-index .hero-fade-layer {
        background-size: cover !important;
        background-position: 85% center !important;
    }
}
  .page-index .hero-content { max-width: 92%; }
  .page-index .hero h1 { font-size: clamp(42px, 13vw, 62px) !important; }
  .page-index .hero p { font-size: 13px !important; letter-spacing: 2px !important; }
  .page-index .buttons { flex-direction: column; align-items: stretch; max-width: 280px; }
  .page-index .button { text-align: center; }
  .page-index .benefits { grid-template-columns: 1fr 1fr !important; }
  .page-index .benefit { border-right: 1px solid #333; border-bottom: 1px solid #333; }
  .page-index .benefit:nth-child(2n) { border-right: 0; }
  .page-index section { padding-left: 16px !important; padding-right: 16px !important; }
  .page-index .categories { grid-template-columns: 1fr 1fr !important; }
  .page-index .category { height: 230px !important; }
  .page-index .new-in-slider { width: 100% !important; }
  .page-index .new-in-viewport { overflow-x: auto !important; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .page-index #home-new-products { transform: none !important; transition: none !important; }
  .page-index #home-new-products .product { width: min(72vw, 270px) !important; scroll-snap-align: start; }
  .page-index .new-in-arrow { display: none !important; }
  .page-index .brand-shirt { grid-template-columns: 1fr !important; padding: 46px 22px !important; gap: 18px; }
  .page-index .brand-shirt h2 { font-size: 31px !important; }
  .page-index .shirt-placeholder { height: 260px !important; }
  .page-index .shirt-placeholder img { height: 110% !important; }

  /* grids */
  .page-shop main, .page-new-in .new-in-main { padding: 42px 16px 70px !important; }
  .page-shop h1, .page-new-in h1 { font-size: 30px !important; }
  .page-shop .intro { margin-bottom: 30px !important; }
  .page-shop .shop-grid, .page-new-in .new-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .page-shop .shop-image, .page-new-in .new-card-image { height: 220px !important; }
  .page-shop .shop-info, .page-new-in .new-card-info { padding-left: 12px !important; padding-right: 12px !important; }

  /* product */
  .page-produkt header, .page-checkout header {
    height: auto !important;
    min-height: 92px;
    padding: 12px 16px !important;
  }
  .page-produkt header img, .page-checkout header img { width: 145px !important; }
  .page-produkt .back, .page-checkout .back {
    left: 14px !important;
    max-width: 92px;
    font-size: 9px !important;
    line-height: 1.35;
    letter-spacing: 1px !important;
  }
  .page-produkt .header-cart {
    right: 14px !important;
    max-width: 90px;
    text-align: right;
    font-size: 9px !important;
    line-height: 1.35;
    letter-spacing: 1px !important;
  }
  .page-produkt main { padding: 35px 16px 65px !important; }
  .page-produkt .product-layout { grid-template-columns: 1fr !important; gap: 30px !important; }
  .page-produkt .product-image { min-height: 0 !important; height: min(100vw, 520px); }
  .page-produkt .product-info h1 { font-size: 31px !important; }
  .page-produkt .price { margin-top: 22px !important; }
  .page-produkt .size { width: 44px; height: 44px; }
  .page-produkt .care-popup { padding: 12px !important; }
  .page-produkt .care-popup-box { max-height: 90vh; overflow-y: auto; padding: 22px !important; }

  /* cart */
  .page-warenkorb main { padding: 42px 16px 70px !important; }
  .page-warenkorb h1 { font-size: 30px !important; }
  .page-warenkorb .cart-item {
    grid-template-columns: 92px 1fr !important;
    gap: 14px !important;
    padding: 14px !important;
    align-items: start !important;
  }
  .page-warenkorb .cart-image { width: 92px !important; height: 92px !important; }
  .page-warenkorb .cart-info h2 { font-size: 15px !important; }
  .page-warenkorb .cart-controls {
    grid-column: 1 / -1;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px;
    padding-top: 8px !important;
  }
  .page-warenkorb .quantity-buttons { margin: 0 !important; }
  .page-warenkorb .cart-item-price { margin: 0 !important; }
  .page-warenkorb .cart-actions { flex-direction: column !important; }
  .page-warenkorb .shop-button { text-align: center; }
  .page-warenkorb .cart-checkout-area { width: 100%; justify-content: space-between; gap: 12px !important; }
  .page-warenkorb .checkout-button { text-align: center; }

  /* checkout */
  .page-checkout main { padding: 38px 16px 70px !important; }
  .page-checkout h1 { font-size: 30px !important; }
  .page-checkout .checkout-layout { grid-template-columns: 1fr !important; gap: 20px !important; }
  .page-checkout .checkout-right { position: static !important; }
  .page-checkout .checkout-box { padding: 20px 16px !important; }
  .page-checkout .form-grid { grid-template-columns: 1fr !important; gap: 0 !important; }
  .page-checkout .form-group.full { grid-column: auto !important; }
  .page-checkout .option { align-items: flex-start; }
  .page-checkout .checkout-brand-message h2 { font-size: clamp(34px, 11vw, 50px) !important; }
  .page-checkout .payment-return-box { width: calc(100% - 28px) !important; }
  .page-checkout .cf-turnstile { max-width: 100%; overflow: hidden; }

  /* confirmation pages */
  .page-bestellung main, .page-bestellung-erfolgreich main { padding-left: 16px !important; padding-right: 16px !important; }
  .page-bestellung .success-box, .page-bestellung .info-box,
  .page-bestellung-erfolgreich .success { width: 100% !important; max-width: 100% !important; }
  .page-bestellung .actions { flex-direction: column !important; }
  .page-bestellung .actions .button { width: 100%; text-align: center; }

  /* legal / service / about pages */
  .page-agb main, .page-impressum main, .page-datenschutz main, .page-widerruf main,
  .page-kontakt .contact-main, .page-kundenservice main, .page-versand main, .page-ueber-uns .about-main {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 42px !important;
    padding-bottom: 70px !important;
  }
  .page-agb header {
    min-height: 86px;
    padding: 12px 16px !important;
  }
  .page-agb .back { left: 14px !important; font-size: 9px !important; max-width: 95px; line-height: 1.35; }
  .page-agb header img { width: 145px !important; }
  .page-ueber-uns .about-story { grid-template-columns: 1fr !important; gap: 22px !important; }
}

@media (max-width: 560px) {
  body:not(.page-produkt):not(.page-checkout):not(.page-agb):not(.page-bestellung):not(.page-bestellung-erfolgreich) .topbar > :nth-child(2) { display: none; }
  .page-index .categories { grid-template-columns: 1fr !important; }
  .page-index .category { height: 250px !important; }
  .page-shop .shop-grid, .page-new-in .new-grid { grid-template-columns: 1fr 1fr !important; }
  .page-shop .shop-image, .page-new-in .new-card-image { height: 190px !important; }
  .page-shop .shop-info h2, .page-new-in .new-card-info h2 { font-size: 13px !important; }
  .page-warenkorb .cart-checkout-area { flex-direction: column; align-items: stretch !important; }
  .page-warenkorb .cart-total { text-align: center !important; }
  .page-checkout .option-price { white-space: nowrap; }
}

/* Mobile live-test corrections – 2026-09-06 */
@media (max-width: 900px) {
  /* Home hero: keep "BE YOUR OWN" together on normal phone widths. */
  .page-index .hero h1 {
    font-size: clamp(38px, 10.8vw, 50px) !important;
    line-height: 1 !important;
  }

  /* Home NEW IN: real two-column mobile grid instead of squeezed desktop slider. */
  .page-index .new-in-viewport {
    overflow: visible !important;
  }
  .page-index #home-new-products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
    transform: none !important;
  }
  .page-index #home-new-products .product {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }
  .page-index #home-new-products .product-image {
    height: 210px !important;
  }
  .page-index #home-new-products .product-info {
    position: static !important;
    padding: 12px !important;
    min-height: 145px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }
  .page-index #home-new-products .product-info h3,
  .page-index #home-new-products .product-info p {
    margin: 0 !important;
  }
  .page-index #home-new-products .home-product-price {
    position: static !important;
    margin-top: auto;
    font-size: 18px !important;
  }
  .page-index #home-new-products .buy-button {
    position: static !important;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 10px 8px !important;
  }

  /* Product page: remove unnecessary mobile bottom breathing room. */
  .page-produkt main {
    padding-bottom: 28px !important;
  }
}

@media (max-width: 380px) {
  .page-index #home-new-products {
    grid-template-columns: 1fr !important;
  }
  .page-index #home-new-products .product-image {
    height: 280px !important;
  }
}
