/*
Theme Name: SG4 Werkstatt
Theme URI: https://sg4.shop
Author: SG4
Description: Werkstatt mit Shop. Eigenständiges, schlankes Theme für SG4.shop – WooCommerce-ready, SiteOrigin-kompatibel, CSS-Variablen, keine Frameworks.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sg4
Tags: e-commerce, custom-menu, custom-logo, translation-ready
*/

:root {
  --sg4-anthrazit: #1d1f21;
  --sg4-text: #26282b;
  --sg4-text-muted: #6b6f74;
  --sg4-bg: #ffffff;
  --sg4-bg-soft: #f5f4f2;
  --sg4-bg-card: #fafaf9;
  --sg4-border: #e7e5e2;
  --sg4-akzent: #ef7d00;
  --sg4-akzent-hover: #ff8d14;
  --sg4-akzent-dunkel: #c96800;
  --sg4-akzent-soft: rgba(239,125,0,0.1);
  --sg4-font-head: 'Space Grotesk', system-ui, sans-serif;
  --sg4-font-body: 'Instrument Sans', system-ui, sans-serif;
  --sg4-radius: 18px;
  --sg4-radius-btn: 12px;
  --sg4-shadow-hover: 0 20px 40px rgba(29,31,33,0.1);
}

body { font-family: var(--sg4-font-body); color: var(--sg4-text); background: var(--sg4-bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--sg4-font-head); font-weight: 600; letter-spacing: -0.02em; }
a { color: var(--sg4-akzent); text-decoration: none; }
a:hover { color: var(--sg4-akzent-dunkel); }
::selection { background: var(--sg4-akzent); color: #fff; }

/* ---- Sektionen ---- */
.sg4-section { padding: 120px 0; }
.sg4-section--dunkel { background: var(--sg4-anthrazit); color: #fff; }
.sg4-section--soft { background: var(--sg4-bg-soft); }
.sg4-eyebrow { font-family: var(--sg4-font-head); font-size: 14px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sg4-akzent); display: block; margin-bottom: 16px; }
.sg4-h1 { font-size: clamp(46px, 6.5vw, 80px); line-height: 1.02; margin: 0 0 24px; text-wrap: balance; }
.sg4-h2 { font-size: clamp(32px, 4vw, 44px); line-height: 1.15; margin: 0 0 20px; }
.sg4-lead { font-size: 19px; line-height: 1.65; color: var(--sg4-text-muted); max-width: 560px; }
.sg4-section--dunkel .sg4-lead { color: rgba(255,255,255,0.7); }

/* ---- Buttons ---- */
.sg4-btn, .sg4-btn:visited { display: inline-block; background: var(--sg4-akzent); color: #fff !important; font-weight: 600; font-size: 16px; padding: 16px 32px; border-radius: var(--sg4-radius-btn); transition: background 0.2s ease, transform 0.2s ease; }
.sg4-btn:hover { background: var(--sg4-akzent-hover); transform: translateY(-2px); }
.sg4-btn--ghost { background: transparent; border: 1px solid rgba(255,255,255,0.4); }
.sg4-btn--ghost:hover { background: rgba(239,125,0,0.15); border-color: var(--sg4-akzent); }
.sg4-btn--dunkel { background: var(--sg4-text); }
.sg4-btn--dunkel:hover { background: var(--sg4-akzent); }

/* ---- Badge ---- */
.sg4-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sg4-akzent); background: var(--sg4-akzent-soft); border: 1px solid rgba(239,125,0,0.35); padding: 6px 14px; border-radius: 999px; }
.sg4-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--sg4-akzent); }

/* ---- Hero ---- */
.sg4-hero { position: relative; min-height: 88vh; display: flex; align-items: flex-end; background: var(--sg4-anthrazit) center/cover no-repeat; color: #fff; overflow: hidden; }
.sg4-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgba(20,21,23,0.88) 0%, rgba(20,21,23,0.55) 45%, rgba(20,21,23,0.15) 75%, rgba(20,21,23,0) 100%); }
.sg4-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,21,23,0.75) 0%, rgba(20,21,23,0) 40%); }
.sg4-hero__inner { position: relative; z-index: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 160px 32px 88px; }
.sg4-hero__inner h1 { text-shadow: 0 2px 24px rgba(0,0,0,0.4); }
.sg4-hero .sg4-lead { color: rgba(255,255,255,0.8); text-shadow: 0 1px 12px rgba(0,0,0,0.4); }

/* ---- Karten ---- */
.sg4-card { background: #fff; border-radius: var(--sg4-radius); overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.sg4-card:hover { transform: translateY(-6px); box-shadow: var(--sg4-shadow-hover); }
.sg4-card__bild { height: 240px; overflow: hidden; }
.sg4-card__bild img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.sg4-card:hover .sg4-card__bild img { transform: scale(1.04); }
.sg4-card__body { padding: 28px; }
.sg4-card__body h3 { font-size: 22px; margin: 0 0 10px; }
.sg4-card__body p { font-size: 15px; line-height: 1.6; color: var(--sg4-text-muted); margin: 0; }

/* ---- Produktkarten (WooCommerce-ready) ---- */
.sg4-produkt { background: #fff; border-radius: var(--sg4-radius); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.sg4-produkt:hover { transform: translateY(-6px); box-shadow: var(--sg4-shadow-hover); }
.sg4-produkt__bild { height: 260px; background: var(--sg4-bg-card); }
.sg4-produkt__bild img { width: 100%; height: 100%; object-fit: contain; }
.sg4-produkt__body { padding: 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sg4-produkt__preis { font-family: var(--sg4-font-head); font-size: 18px; font-weight: 600; }

/* ---- Icon-Merkmale (Warum SG4) ---- */
.sg4-merkmal__icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 16px; background: var(--sg4-akzent-soft); color: var(--sg4-akzent); margin-bottom: 18px; }
.sg4-merkmal h3 { font-size: 20px; margin: 0 0 10px; }
.sg4-merkmal p { font-size: 15px; line-height: 1.65; color: var(--sg4-text-muted); margin: 0; }

/* ---- Formulare ---- */
.sg4-form { background: #fff; border-radius: 20px; padding: 40px; box-shadow: 0 10px 30px rgba(29,31,33,0.06); }
.sg4-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.sg4-form input[type=text], .sg4-form input[type=email], .sg4-form textarea { width: 100%; font-family: inherit; font-size: 15px; padding: 13px 16px; border: 1px solid var(--sg4-border); border-radius: 10px; background: var(--sg4-bg-card); color: var(--sg4-text); outline: none; box-sizing: border-box; }
.sg4-form input:focus, .sg4-form textarea:focus { border-color: var(--sg4-akzent); background: #fff; }

/* ---- WooCommerce-Entschlackung ---- */
.woocommerce .star-rating, .woocommerce .product_meta .sku_wrapper { display: none; }
.woocommerce ul.products li.product { text-align: left; }
.woocommerce ul.products li.product .price { font-family: var(--sg4-font-head); color: var(--sg4-text); font-weight: 600; }
.woocommerce a.button, .woocommerce button.button.alt { background: var(--sg4-akzent); color: #fff; border-radius: var(--sg4-radius-btn); font-weight: 600; }
.woocommerce a.button:hover, .woocommerce button.button.alt:hover { background: var(--sg4-akzent-hover); }

/* ---- Sanftes Einblenden (mit .sg4-reveal auf Widgets/Rows) ---- */
@media (prefers-reduced-motion: no-preference) {
  .sg4-reveal { opacity: 0; translate: 0 20px; transition: opacity 0.7s ease, translate 0.7s ease; }
  .sg4-reveal.ist-sichtbar { opacity: 1; translate: 0 0; }
}

@media (max-width: 780px) {
  .sg4-section { padding: 72px 0; }
  .sg4-hero__inner { padding: 120px 24px 64px; }
}


/* ==== Theme-Layout ==== */
.sg4-container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* Header */
.sg4-header { position: sticky; top: 0; z-index: 50; background: var(--sg4-anthrazit); border-bottom: 1px solid rgba(255,255,255,0.08); }
.sg4-header__inner { height: 72px; display: flex; align-items: center; gap: 40px; }
.sg4-header__logo img { height: 34px; width: auto; display: block; }
.sg4-nav { margin-left: auto; }
.sg4-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 32px; }
.sg4-nav a { color: rgba(255,255,255,0.72); font-size: 15px; font-weight: 500; }
.sg4-nav a:hover, .sg4-nav .current-menu-item > a { color: var(--sg4-akzent); }
.sg4-header__actions { display: flex; align-items: center; gap: 20px; }
.sg4-header__cart { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; color: rgba(255,255,255,0.85); position: relative; }
.sg4-header__cart:hover { background: rgba(255,255,255,0.08); color: var(--sg4-akzent); }
.sg4-header__cart .sg4-cart-anzahl { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--sg4-akzent); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.sg4-header__cta { background: var(--sg4-akzent); color: #fff !important; font-size: 14px; font-weight: 600; padding: 10px 20px; border-radius: 10px; transition: background 0.2s ease, transform 0.2s ease; }
.sg4-header__cta:hover { background: var(--sg4-akzent-hover); transform: translateY(-1px); }

/* Footer */
.sg4-footer { background: var(--sg4-anthrazit); color: rgba(255,255,255,0.72); }
.sg4-footer__spalten { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; padding: 80px 0 64px; }
.sg4-footer h2, .sg4-footer h3, .sg4-footer .widget-title { font-family: var(--sg4-font-head); font-size: 14px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; margin: 0 0 14px; }
.sg4-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.sg4-footer a { color: rgba(255,255,255,0.6); font-size: 15px; }
.sg4-footer a:hover { color: var(--sg4-akzent); }
.sg4-footer__logo img { height: 40px; width: auto; }
.sg4-footer__unten { border-top: 1px solid rgba(255,255,255,0.1); padding: 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,0.4); }

/* Blog / Archiv */
.sg4-archiv { padding: 96px 0; }
.sg4-archiv__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; margin-top: 48px; }
.sg4-blogkarte { background: #fff; border: 1px solid var(--sg4-border); border-radius: var(--sg4-radius); overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.sg4-blogkarte:hover { transform: translateY(-6px); box-shadow: var(--sg4-shadow-hover); }
.sg4-blogkarte__bild img { width: 100%; height: 220px; object-fit: cover; display: block; }
.sg4-blogkarte__body { padding: 26px; }
.sg4-blogkarte__body h2 { font-size: 20px; margin: 0 0 10px; }
.sg4-blogkarte__body h2 a { color: var(--sg4-text); }
.sg4-blogkarte__body h2 a:hover { color: var(--sg4-akzent); }
.sg4-blogkarte__body p { font-size: 14px; line-height: 1.6; color: var(--sg4-text-muted); margin: 0; }

/* Einzelbeitrag / Seite */
.sg4-inhalt { padding: 96px 0; }
.sg4-inhalt--schmal { max-width: 760px; margin: 0 auto; }
.sg4-inhalt h1.entry-title { font-size: clamp(36px, 5vw, 56px); line-height: 1.1; margin: 0 0 32px; }
.sg4-inhalt .entry-content { font-size: 17px; line-height: 1.75; }
/* Seiten mit Page Builder: volle Breite, kein Innenabstand */
.sg4-inhalt--builder { padding: 0; max-width: none; }

@media (max-width: 900px) {
  .sg4-footer__spalten { grid-template-columns: 1fr 1fr; }
  .sg4-nav { display: none; } /* Mobile: Menü über Plugin oder eigene Lösung ergänzen */
}


/* ==== SiteOrigin-Zeilen: Hintergrund randlos, Inhalt in 1240px-Spalte ==== */
.sg4-inhalt--builder .panel-row-style {
  padding-left: max(32px, calc((100vw - 1240px) / 2)) !important;
  padding-right: max(32px, calc((100vw - 1240px) / 2)) !important;
}
/* Hero-Zeile ausnehmen (volle Breite fuer Bild) */
.sg4-inhalt--builder .sg4-hero-row { padding-left: 0 !important; padding-right: 0 !important; }
/* Zeilen ohne eigenen Style ebenfalls zentrieren */
.sg4-inhalt--builder .panel-grid.panel-no-style {
  max-width: 1240px; margin-left: auto; margin-right: auto;
  padding-left: 32px; padding-right: 32px; box-sizing: border-box;
}


/* ==== SiteOrigin: Standard-Zeilenabstand entfernen (Sektionen stossen nahtlos aneinander) ==== */
.sg4-inhalt--builder .panel-grid { margin-bottom: 0 !important; }
.sg4-inhalt--builder .so-panel { margin-bottom: 0 !important; }
