/* Gravur Konfigurator v2.0.0 | Philipp Pirker | laser4you.at */

/* ===== SCROLL-BUTTON ===== */
.gk-scroll-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    margin: 0 0 16px;
    background: transparent;
    color: #c9a96e;
    border: 2px solid #c9a96e;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.gk-scroll-btn:hover {
    background: #c9a96e;
    color: #fff;
    text-decoration: none;
}

/* ===== KONFIGURATOR WRAPPER – full-width ===== */
.gk-konfigurator {
    clear: both;
    width: 100%;
    margin: 40px 0 0;
    padding: 32px 0 0;
    font-family: inherit;
    border-top: 2px solid #c9a96e;
    scroll-margin-top: 80px; /* Abstand beim Smooth-Scroll vom Header */
}

/* ===== HEADER ===== */
.gk-header {
    margin-bottom: 24px;
}

.gk-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.gk-icon {
    color: #c9a96e;
    font-size: 20px;
    flex-shrink: 0;
}

.gk-header p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* ===== HAUPT-LAYOUT: Canvas links (groß), Controls rechts ===== */
.gk-body {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .gk-body {
        grid-template-columns: 1fr;
    }
}

/* ===== LINKE SPALTE: Canvas ===== */
.gk-left {
    display: flex;
    flex-direction: column;
}

.gk-canvas-wrap {
    background: #111;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.gk-canvas-wrap canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

.gk-canvas-footer {
    border: 1px solid #e0d8cc;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: #faf9f7;
}

.gk-canvas-hint {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    padding: 7px 12px;
    margin: 0;
    border-bottom: 1px solid #e8e2d8;
    line-height: 1.4;
}

.gk-canvas-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.gk-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #888;
    background: transparent;
    border: none;
    border-right: 1px solid #e8e2d8;
    cursor: pointer;
    transition: all 0.15s;
}

.gk-action-btn:last-child { border-right: none; }
.gk-action-btn:hover { background: #fff5f5; color: #c0392b; }
.gk-action-icon { font-size: 15px; color: #ccc; line-height: 1; }

/* ===== RECHTE SPALTE: Controls ===== */
.gk-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 80px; /* Klebt beim Scrollen am Header */
}

.gk-section {
    background: #faf9f7;
    border: 1px solid #e8e2d8;
    border-radius: 12px;
    padding: 16px 18px;
}

.gk-section-cta {
    background: transparent;
    border: none;
    padding: 0;
}

.gk-label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.gk-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1a1a1a;
    margin-bottom: 10px;
    box-sizing: border-box;
    font-family: inherit;
}

.gk-input:focus {
    outline: none;
    border-color: #c9a96e;
    box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

.gk-row { display: flex; gap: 8px; }
.gk-field { flex: 1; }
.gk-field-sm { flex: 0 0 72px; }

/* ===== BUTTONS ===== */
.gk-btn {
    display: block;
    width: 100%;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    border: none;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4;
}

.gk-btn-primary {
    background: #c9a96e;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    padding: 16px;
    letter-spacing: 0.2px;
}

.gk-btn-primary:hover    { background: #b8944f; }
.gk-btn-primary:disabled { background: #ddd; cursor: not-allowed; }

.gk-btn-outline {
    background: #fff;
    color: #444;
    border: 1px solid #ddd;
    margin-top: 4px;
}

.gk-btn-outline:hover { border-color: #c9a96e; color: #8B6030; }

.gk-cta-hint {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    margin: 8px 0 0;
    line-height: 1.5;
}

.gk-hint {
    font-size: 11px;
    color: #bbb;
    margin: 6px 0 0;
    line-height: 1.5;
}

/* ===== STATUS ===== */
.gk-save-status {
    text-align: center;
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
    line-height: 1.4;
}

.gk-save-status.success { color: #27ae60; }
.gk-save-status.error   { color: #c0392b; }
.gk-save-status.loading { color: #c9a96e; }

/* Hinweis, wenn die Gravur die gravierbare Flaeche verlaesst.
   Bewusst als Hinweis und nicht als Sperre - der Kunde entscheidet. */
.gk-flaeche-warnung {
    font-size: 12.5px;
    line-height: 1.45;
    color: #8a3227;
    background: #fdf1ef;
    border: 1px solid #f0c8c0;
    border-radius: 6px;
    padding: 9px 11px;
    margin: 0 0 10px;
}

/* Spinner waehrend des Speicherns: zeigt, dass wirklich etwas laeuft */
.gk-spinner {
    display: inline-block;
    width: 13px; height: 13px;
    margin-right: 7px;
    vertical-align: -2px;
    border: 2px solid rgba(201, 169, 110, .30);
    border-top-color: #c9a96e;
    border-radius: 50%;
    animation: gk-drehen .7s linear infinite;
}

@keyframes gk-drehen { to { transform: rotate(360deg); } }

/* Der Speichern-Button pulsiert dezent, solange er deaktiviert ist */
.gk-save-btn:disabled {
    cursor: progress;
    animation: gk-pulsieren 1.4s ease-in-out infinite;
}

@keyframes gk-pulsieren {
    0%, 100% { opacity: .60; }
    50%      { opacity: .90; }
}

@media (prefers-reduced-motion: reduce) {
    .gk-spinner            { animation-duration: 2s; }
    .gk-save-btn:disabled  { animation: none; opacity: .65; }
}

/* ===== WARENKORB ANZEIGE ===== */
/*
 * Gravur-Vorschau im Warenkorb.
 *
 * Sie ist hier die wichtigste Information: Der Kunde prueft an dieser Stelle
 * zum letzten Mal, ob er das Richtige bestellt. Vorher war sie 64 px gross und
 * per object-fit:cover quadratisch beschnitten - man sah weder den Gravurtext
 * noch, wo er sitzt. Jetzt gross genug zum Erkennen und ohne Beschnitt.
 */
.gk-cart-gravur {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 10px;
    padding: 12px 14px;
    background: #faf9f7;
    border: 1px solid #e8e2d8;
    border-radius: 8px;
    border-left: 3px solid #c9a96e;
}

/*
 * ACHTUNG - diese Datei wird im WARENKORB NICHT GELADEN.
 *
 * Seit 2.12.0 laedt konfigurator.css nur noch auf Produktseiten (richtig so).
 * Die Warenkorb-Vorschau bekam dadurch von 2.12.0 bis 2.13.2 keine dieser
 * Regeln zu sehen und wurde vom Theme mit 60 px dargestellt statt mit 180 px.
 *
 * Die Groesse steht deshalb seit 2.13.3 als style-Attribut im HTML selbst
 * (GK_Order_Meta::STIL_BILD und Nachbarn) - das wirkt auch in Bestell-Mails,
 * wo externe CSS-Dateien grundsaetzlich nichts ausrichten.
 *
 * Was hier steht, ist nur noch die Zugabe fuer Seiten, auf denen die Datei
 * tatsaechlich geladen ist. Wer die Groesse aendern will, aendert sie DORT.
 */
.gk-cart-preview-link {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
    position: relative;
}

.gk-cart-preview-img {
    width: 180px;
    max-width: 100%;
    height: auto;
    /* contain statt cover: lieber Rand als abgeschnittene Gravur */
    object-fit: contain;
    border-radius: 6px;
    display: block;
    border: 1px solid #e0d8cc;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}

.gk-cart-preview-link:hover .gk-cart-preview-img,
.gk-cart-preview-link:focus-visible .gk-cart-preview-img {
    transform: scale(1.02);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .16);
}

.gk-cart-preview-lupe {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #8a7560;
    text-align: center;
    line-height: 1.3;
}

.gk-cart-text {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    padding-top: 2px;
}

/* Schmale Spalten (Warenkorb im Mobil-Layout): untereinander statt nebeneinander */
@media (max-width: 600px) {
    .gk-cart-gravur {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .gk-cart-preview-img {
        width: 100%;
    }
}

.gk-cart-text strong {
    color: #1a1a1a;
    font-weight: 500;
}
