/* ==========================================================================
   GGAS RESPONSIVE · alle Bildschirmformate
   Wird als LETZTE Theme-Datei geladen (nach ggas-integration.css).

   Abgedeckt:
   A  Basis: Safe Areas (Notch / Dynamic Island), dynamische Viewport-Höhen
   B  Kartenfächer passt sich der Bildschirmhöhe an (Laptops, kurze Fenster)
   C  Große Monitore: 1440p / 4K wachsen proportional mit (--ui)
   D  Ultrawide 21:9 und Super-Ultrawide 32:9: breitere Bühne, mehr Spalten
   E  Handys im Querformat und sehr niedrige Fenster
   F  Sehr schmale Geräte (Fold zugeklappt, 280–359 px)
   G  Produktseite: Bild bleibt immer vollständig im Bild

   Prinzip: Kleine Schritte über min-width UND min-height, damit z. B. ein
   3840×1080-Monitor (32:9) nicht wie ein 4K-Monitor vergrößert wird.
   ========================================================================== */

/* A · BASIS ================================================================ */
:root{
  --ui:1;                                   /* Skalierung für px-Bauteile */
  --safe-l:env(safe-area-inset-left,0px);
  --safe-r:env(safe-area-inset-right,0px);
  --safe-b:env(safe-area-inset-bottom,0px);
  --arena-reserve:calc(250px * var(--ui)); /* Header + Kategorien über der Bühne */
}
@supports (min-height:100svh){
  body{min-height:100svh}
  .gg-support-thread{max-height:min(62dvh,560px)}
}
/* Inhalte nie unter Notch / abgerundete Ecken legen (iPhone quer, Android-Punch-Hole) */
.shell,.gg-all-products-grid{
  padding-left:max(var(--gutter),var(--safe-l));
  padding-right:max(var(--gutter),var(--safe-r))}
.site-header{
  padding-left:max(var(--gutter),var(--safe-l));
  padding-right:max(var(--gutter),var(--safe-r))}
@media (max-width:600px){.site-header{padding-left:max(10px,var(--safe-l));padding-right:max(10px,var(--safe-r))}}
.footer-bottom{padding-bottom:calc(28px + var(--safe-b))}
.ggas-sticky-bar{left:max(12px,var(--safe-l));right:max(12px,var(--safe-r))}
.ggas-skip-link{left:max(16px,var(--safe-l))}
/* Mobiles Menü darf auf niedrigen Bildschirmen nie aus dem Bild laufen */
.gg-mobile-menu-panel{max-height:calc(100vh - var(--header-h) - 24px);overflow-y:auto;overscroll-behavior:contain}
@supports (height:100dvh){.gg-mobile-menu-panel{max-height:calc(100dvh - var(--header-h) - 24px)}}
/* Lange Wörter / URLs sprengen nie das Layout */
.page-content,.woocommerce-MyAccount-content,.ggas-prose,.footer-identity{overflow-wrap:break-word}
img,video,iframe,embed,object{max-width:100%}

/* B · KARTENFÄCHER FOLGT DER BILDSCHIRMHÖHE ================================
   Breite nach Viewport-Breite (wie bisher), aber nie so hoch, dass die
   aktive Karte samt Steuerung unter den Bildschirmrand rutscht. */
.gg-card-arena.is-ready{
  --card-width:clamp(220px,min(24vw,calc((100vh - var(--arena-reserve)) / 1.78)),calc(340px * var(--ui)));
  --stage-h:calc(var(--card-width) * 1.76 + 72px * var(--ui))}
@supports (height:100svh){
  .gg-card-arena.is-ready{--card-width:clamp(220px,min(24vw,calc((100svh - var(--arena-reserve)) / 1.78)),calc(340px * var(--ui)))}
}
/* Tablets hochkant: viel Höhe übrig → größere Karten */
@media (min-width:651px) and (max-width:1199px) and (orientation:portrait){
  .gg-card-arena.is-ready{--card-width:clamp(220px,min(38vw,calc((100vh - var(--arena-reserve)) / 1.78)),340px)}
  @supports (height:100svh){
    .gg-card-arena.is-ready{--card-width:clamp(220px,min(38vw,calc((100svh - var(--arena-reserve)) / 1.78)),340px)}
  }
}
@media (max-width:650px){
  :root{--arena-reserve:228px}
  .gg-card-arena.is-ready{
    --card-width:clamp(200px,min(76vw,calc((100vh - var(--arena-reserve)) / 1.78)),280px);
    --stage-h:calc(var(--card-width) * 1.78 + 72px)}
  @supports (height:100svh){
    .gg-card-arena.is-ready{--card-width:clamp(200px,min(76vw,calc((100svh - var(--arena-reserve)) / 1.78)),280px)}
  }
}
/* Kleinere Karten: Inhalt kompakter, damit der Button nie abgeschnitten wird */
@media (max-height:760px) and (min-width:651px),(max-width:650px) and (max-height:720px){
  .gg-card-arena ul.products li.product .gg-card-label{margin-bottom:6px}
  .gg-card-arena ul.products li.product .gg-merch-subtitle{display:none}
  .gg-card-arena ul.products li.product .woocommerce-loop-product__title{font-size:.9375rem}
  .gg-card-arena ul.products li.product .price{font-size:1.0625rem;padding-top:6px}
  .gg-card-arena ul.products li.product .button{margin-top:8px}
}

/* C · GROSSE MONITORE ======================================================
   Schritte orientieren sich an der nutzbaren Fensterfläche (Breite UND Höhe).
   --ui skaliert px-Bauteile, die Root-Schriftgröße skaliert alles in rem. */
@media (min-width:1440px){
  :root{--shell:1320px}
}
@media (min-width:1680px) and (min-height:860px){
  :root{--ui:1.0625;--shell:clamp(1320px,150vh,1480px)}
  html{font-size:106.25%}
}
@media (min-width:2200px) and (min-height:1180px){       /* 1440p / 3440×1440 / 5120×1440 */
  :root{--ui:1.1875;--shell:clamp(1480px,145vh,1840px)}
  html{font-size:118.75%}
}
@media (min-width:2900px) and (min-height:1560px){       /* 3K / 5K-Retina mit Skalierung */
  :root{--ui:1.375;--shell:clamp(1840px,140vh,2400px)}
  html{font-size:137.5%}
}
@media (min-width:3600px) and (min-height:1900px){       /* 4K bei 100 % */
  :root{--ui:1.625;--shell:clamp(2200px,140vh,2900px)}
  html{font-size:162.5%}
}
@media (min-width:1680px) and (min-height:860px){
  :root{--gutter:calc(40px * var(--ui));--touch:calc(44px * var(--ui));--header-h:calc(86px * var(--ui))}
  /* Header */
  .site-header{padding-top:calc(12px * var(--ui))}
  .site-header .header-inner{min-height:calc(66px * var(--ui));padding:calc(8px * var(--ui)) calc(8px * var(--ui)) calc(8px * var(--ui)) calc(18px * var(--ui))}
  .site-header.is-scrolled .header-inner{min-height:calc(58px * var(--ui))}
  .gg-header-logo img{height:calc(46px * var(--ui))}
  .site-header.is-scrolled .gg-header-logo img{height:calc(40px * var(--ui))}
  .primary-nav a{min-height:calc(40px * var(--ui));padding:0 calc(16px * var(--ui))}
  .gg-cart-link .cart-count{min-width:calc(22px * var(--ui));height:calc(22px * var(--ui))}
  .gg-language-switch a{min-width:calc(36px * var(--ui));height:calc(38px * var(--ui))}
  .gg-mode-toggle svg,.gg-mobile-menu>summary svg,.gg-cart-link svg{width:calc(20px * var(--ui));height:calc(20px * var(--ui))}
  .filter-chip{min-height:calc(40px * var(--ui));padding:0 calc(16px * var(--ui))}
  /* Karten */
  .woocommerce ul.products li.product{--frame:calc(7px * var(--ui));border-radius:calc(16px * var(--ui))}
  .gg-deck-controls button{width:calc(44px * var(--ui));height:calc(44px * var(--ui))}
  /* Footer */
  .gg-footer-logo img{width:calc(170px * var(--ui))}
  .footer-top{grid-template-columns:minmax(0,1.6fr) repeat(2,minmax(calc(160px * var(--ui)),.6fr))}
  /* Konto, Warenkorb, Kasse */
  .woocommerce-account.logged-in .page-content>.woocommerce{grid-template-columns:calc(272px * var(--ui)) minmax(0,1fr)}
  .wc-block-components-sidebar-layout{grid-template-columns:minmax(0,1fr) minmax(calc(300px * var(--ui)),calc(400px * var(--ui)))}
  .ggas-prose-layout{grid-template-columns:minmax(0,1fr) calc(260px * var(--ui))}
  .flex-control-thumbs li{width:calc(76px * var(--ui))!important}
}
/* Produktraster: so viele Spalten, wie sinnvoll Platz haben (4 → 5 → 6 → 7) */
@media (min-width:1680px){
  .gg-all-products-grid .woocommerce ul.products.products:not(.gg-card-arena ul.products),
  body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag) .commerce-main ul.products.products:not(.gg-card-arena ul.products){
    grid-template-columns:repeat(auto-fill,minmax(calc(240px * var(--ui)),1fr))}
}

/* D · ULTRAWIDE 21:9 / 32:9 ================================================
   Die Inhaltsbreite richtet sich nach der Höhe – so bleibt alles im Blickfeld
   und die Seite wird nicht zu einem schmalen Streifen. */
@media (min-aspect-ratio:2/1) and (min-width:2000px){
  :root{--shell:clamp(1480px,190vh,3000px)}
  .gg-card-arena.is-ready{-webkit-mask:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent);mask:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent)}
  .gg-card-arena.is-ready::before{width:min(1600px,100%)}
  .gg-card-arena.is-ready::after{width:min(1100px,70%)}
}
@media (min-aspect-ratio:3/1) and (min-width:2800px){    /* 32:9 */
  :root{--shell:clamp(1480px,235vh,3600px)}
}
/* Ultrawide-Produktseite: Inhalt nicht endlos in die Breite ziehen */
@media (min-aspect-ratio:2/1) and (min-width:2000px){
  .gg-product-stage{max-width:min(var(--shell),calc(150vh + 2 * var(--gutter)))}
  .ggas-prose-layout,.woocommerce-account .page-content,.woocommerce-cart .page-content,.woocommerce-checkout .page-content{max-width:min(100%,calc(170vh));margin-inline:auto}
}

/* E · HANDY QUER / SEHR NIEDRIGE FENSTER ===================================== */
@media (orientation:landscape) and (max-height:560px){
  :root{--header-h:58px;--arena-reserve:118px}
  .site-header{padding-top:6px}
  .site-header .header-inner{min-height:48px;padding:4px 4px 4px 12px}
  .site-header.is-scrolled{padding-top:4px}
  .site-header.is-scrolled .header-inner{min-height:46px}
  .gg-header-logo img,.site-header.is-scrolled .gg-header-logo img{height:30px}
  .primary-nav a{min-height:36px}
  .gg-cart-link,.gg-mode-toggle,.gg-mobile-menu>summary{min-height:40px}
  .gg-mode-toggle,.gg-mobile-menu>summary{width:40px;height:40px}
  .gg-mobile-menu-panel{top:calc(100% + 6px)}
  .gg-mobile-menu-panel a{min-height:44px}
  .shop-section{padding-top:8px}
  .shop-section::before{font-size:clamp(2rem,9vw,6rem)}
  .category-filters{margin:0 0 2px}
  .filter-chip{min-height:36px}
  /* Kartenfächer: Karte so hoch wie der Bildschirm erlaubt */
  .gg-card-arena.is-ready{
    --card-width:clamp(150px,calc((100vh - var(--arena-reserve)) / 1.76),260px);
    --stage-h:calc(var(--card-width) * 1.74 + 64px)}
  .gg-card-arena.is-ready ul.products li.product{top:8px;height:calc(var(--card-width) * 1.74)}
  .gg-card-arena ul.products li.product{--frame:4px;padding:9px}
  .gg-card-arena ul.products li.product .gg-card-label,
  .gg-card-arena ul.products li.product .gg-merch-subtitle,
  .gg-card-arena ul.products li.product .gg-card-stats{display:none}
  .gg-card-arena ul.products li.product .gg-product-artwork{margin-bottom:6px}
  .gg-card-arena ul.products li.product .woocommerce-loop-product__title{font-size:.8125rem;-webkit-line-clamp:1}
  .gg-card-arena ul.products li.product .price{font-size:.9375rem;padding-top:2px}
  .gg-card-arena ul.products li.product .button{min-height:34px;margin-top:6px;padding:.35em .6em;font-size:.75rem}
  .gg-card-arena.is-ready::after{bottom:44px}
  .gg-card-arena.is-ready .woocommerce::before{bottom:40px;height:60px}
  .gg-deck-controls{bottom:2px;padding:3px}
  .gg-deck-controls button{width:38px;height:38px}
  .gg-deck-hint{display:none}
  .gg-all-products-grid{margin-top:16px}
  /* Footer kompakter */
  .site-footer{margin-top:40px}
  .ggas-footer-marquee{padding:10px 0}
  .footer-top{padding-block:28px 20px}
  .ggas-footer-wordmark{font-size:clamp(2.5rem,9vw,6rem)}
  /* Lange Panels dürfen nicht höher als der Bildschirm sein */
  .gg-support-thread{max-height:calc(100vh - 140px);min-height:180px}
  .ggas-toc,.woocommerce-MyAccount-navigation,.gg-product-showcase{position:static}
}
@supports (height:100svh){
  @media (orientation:landscape) and (max-height:560px){
    .gg-card-arena.is-ready{--card-width:clamp(150px,calc((100svh - var(--arena-reserve)) / 1.76),260px)}
  }
}
/* Handy quer: 3 Spalten im Raster statt 2 */
@media (orientation:landscape) and (max-height:560px) and (min-width:640px) and (max-width:1120px){
  .gg-all-products-grid .woocommerce ul.products.products:not(.gg-card-arena ul.products){grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (orientation:landscape) and (max-height:560px) and (min-width:900px){
  .gg-all-products-grid .woocommerce ul.products.products:not(.gg-card-arena ul.products){grid-template-columns:repeat(4,minmax(0,1fr))}
}

/* F · SEHR SCHMALE GERÄTE (Galaxy Fold zugeklappt, alte iPhones) ============= */
@media (max-width:359px){
  :root{--gutter:12px}
  .site-header{padding:6px max(6px,var(--safe-r)) 0 max(6px,var(--safe-l))}
  .site-header .header-inner{gap:4px;padding:4px 4px 4px 10px}
  .gg-header-logo img,.site-header.is-scrolled .gg-header-logo img{height:26px}
  .header-actions{gap:2px}
  .gg-cart-link{padding:0 8px;gap:4px}
  .gg-mode-toggle,.gg-mobile-menu>summary{width:40px;height:40px}
  .category-filters.has-category-toggle .gg-category-toggle{min-width:0;width:100%}
  .category-filters.has-category-toggle .gg-category-options{min-width:0;width:calc(100vw - 24px)}
  .footer-bottom{gap:8px 16px}
  .ggas-footer-wordmark{font-size:2.4rem}
  h1{font-size:1.625rem}
}
@media (max-width:299px){
  .gg-mode-toggle{display:none}
  .gg-cart-link .cart-count{min-width:18px;height:18px;padding:0 4px}
}

/* G · PRODUKTSEITE: BILD IMMER KOMPLETT SICHTBAR ============================= */
@media (min-width:901px){
  .gg-product-showcase{width:100%;max-width:max(320px,calc(100vh - var(--header-h) - 120px));margin-inline:auto}
}
@media (max-width:900px){
  .gg-product-showcase{max-width:min(560px,max(240px,calc(100vh - var(--header-h) - 96px)))}
}
@supports (height:100svh){
  @media (min-width:901px){.gg-product-showcase{max-width:max(320px,calc(100svh - var(--header-h) - 120px))}}
  @media (max-width:900px){.gg-product-showcase{max-width:min(560px,max(240px,calc(100svh - var(--header-h) - 96px)))}}
}
/* Querformat-Tablets / kleine Laptops: Produkt nebeneinander statt untereinander */
@media (orientation:landscape) and (max-height:560px) and (min-width:700px){
  .gg-product-hero{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:24px}
  .gg-product-showcase{max-width:max(220px,calc(100vh - var(--header-h) - 70px))}
}
