/* ===== Dekofant Customizer — Styles ===== */

/* Konfigurieren-Button im Warenkorb ausblenden (erscheint wegen cUnique) */
.configurepos {
    display: none !important;
}

/* Buttons auf Produktseite */
.dk-buttons-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.dk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.dk-btn-primary {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}
.dk-btn-primary:hover {
    background: #a93226;
    border-color: #a93226;
    color: #fff;
}
.dk-btn-primary:disabled {
    background: #aaa;
    border-color: #aaa;
    cursor: not-allowed;
}

.dk-btn-secondary {
    background: transparent;
    color: #555;
    border-color: #ccc;
}
.dk-btn-secondary:hover {
    border-color: #888;
    color: #333;
}

.dk-btn-link {
    background: transparent;
    color: #888;
    border-color: transparent;
    font-size: 13px;
    font-weight: 400;
    padding: 8px;
}
.dk-btn-link:hover { color: #333; }

.dk-btn-full { width: 100%; }

.dk-aufpreis-badge {
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 4px;
}

/* ===== Modal Overlay ===== */
.dk-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.dk-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Modal Header */
.dk-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.dk-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

.dk-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}
.dk-modal-close:hover { background: #eee; color: #333; }

/* Modal Body */
.dk-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Linke Seite — Canvas */
.dk-modal-left {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f5f0e8;
    border-right: 1px solid #e8e0d0;
    min-width: 0;
}

.dk-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

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

.dk-canvas-loading {
    position: absolute;
    inset: 0;
    background: rgba(245,240,232,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #888;
}

.dk-canvas-hint {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
    text-align: center;
}

/* Rechte Seite — Eingabe */
.dk-modal-right {
    width: 340px;
    min-width: 300px;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Formularfelder */
.dk-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dk-field label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dk-char-count {
    font-weight: 400;
    color: #999;
    font-size: 12px;
}

.dk-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.dk-input:focus {
    outline: none;
    border-color: #c0392b;
}

.dk-field-hint {
    font-size: 11px;
    color: #aaa;
}

/* Schriftart-Buttons */
.dk-font-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dk-font-btn {
    padding: 8px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.15s;
    color: #333;
}
.dk-font-btn:hover {
    border-color: #c0392b;
    color: #c0392b;
}
.dk-font-btn.active {
    border-color: #c0392b;
    background: #fdf0f0;
    color: #c0392b;
    font-weight: 600;
}

/* Konfiguration Zusammenfassung */
.dk-config-summary {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 14px;
    margin-top: auto;
}

.dk-config-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #c0392b;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.dk-config-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 13px;
    color: #555;
    padding: 4px 0;
    gap: 8px;
}
.dk-config-row > span:first-child {
    flex: 1;
    min-width: 0;
}
.dk-config-row > span:last-child,
.dk-config-row > strong:last-child {
    white-space: nowrap;
    flex-shrink: 0;
}
#dk-summary-artikel-name {
    font-size: 11px;
    color: #777;
    white-space: normal;
    line-height: 1.3;
    margin-bottom: 1px;
}

.dk-config-gravur {
    color: #444;
    font-weight: 600;
}

.dk-config-total {
    border-top: 1px solid #ddd;
    margin-top: 6px;
    padding-top: 8px;
    font-size: 15px;
    color: #222;
}

.dk-config-hint {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

/* Responsive */
/* ===== v2.7.1: Sprechblase am Gravurfeld ===== */
.dk-canvas-wrap { position: relative; }

.dk-coach {
    position: absolute;
    z-index: 20;
    max-width: 230px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #2f2a22;
    color: #fff;
    font-size: 12.5px;
    line-height: 1.35;
    box-shadow: 0 4px 14px rgba(0,0,0,.28);
    cursor: pointer;
}
.dk-coach .dk-coach-close {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #f0c674;
    text-transform: uppercase;
    letter-spacing: .4px;
}
/* Zeiger — dreht sich mit der Ausrichtung der Blase */
.dk-coach::after {
    content: '';
    position: absolute;
    border: 7px solid transparent;
}
.dk-coach-top::after    { top: 100%; left: 50%; margin-left: -7px; border-top-color: #2f2a22; }
.dk-coach-bottom::after { bottom: 100%; left: 50%; margin-left: -7px; border-bottom-color: #2f2a22; }
.dk-coach-right::after  { right: 100%; top: 50%; margin-top: -7px; border-right-color: #2f2a22; }

.dk-coach-recall {
    position: absolute;
    z-index: 19;
    right: 8px;
    top: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #d8cdb5;
    background: rgba(255,255,255,.92);
    color: #8a7a5c;
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.dk-coach-recall:hover { background: #fff; color: #5c4f38; }

/* Beschaffenheitshinweis direkt über dem Warenkorb-Button */
.dk-maserung-hinweis {
    margin: 0 0 13px;
    font-size: 11.5px;
    line-height: 1.4;
    color: #9a8e78;
    text-align: center;
}
.dk-fit-warning {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #fdf0f0;
    border: 1px solid #e6b8b8;
    color: #a03030;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

/* v2.7.0: Der Text wird gezogen — der Canvas darf das Scrollen nicht
   an das darunterliegende Panel weiterreichen. */
.dk-canvas-wrap,
.dk-canvas-wrap canvas,
.dk-canvas-wrap .canvas-container {
    touch-action: none;
    -ms-touch-action: none;
}

/* v2.7.4: Auch das Querformat ist ein Handy. Bis 2.7.3 hing alles nur an der
   Breite — gedreht griff nichts davon, deshalb waren dort die Ausrichtungs-
   Buttons wieder da und die Anfasser wieder zu klein für Finger. */
@media (max-width: 680px), (max-height: 500px) {
    /* Vollbild statt zentriertem Kasten: auf dem Handy hat das Modal sonst
       ringsum Rand verschenkt, während das Brett zu klein blieb. */
    .dk-modal-overlay { padding: 0; align-items: stretch; }
    .dk-modal {
        max-width: none;
        max-height: none;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
    }
    .dk-modal-header { padding: 10px 14px; }
    .dk-modal-body   { flex-direction: column; overflow-y: auto; }
    .dk-modal-left {
        border-right: none;
        border-bottom: 1px solid #e8e0d0;
        padding: 10px 8px 12px;
        flex: 0 0 auto;
        /* Auffangnetz: der Canvas wird zwar auf die verfügbare Höhe begrenzt,
           bei zusätzlicher Warnmeldung kann es trotzdem eng werden. */
        overflow-y: auto;
    }
    .dk-canvas-wrap  { max-width: none; }
    .dk-modal-right  { width: 100%; min-width: 0; padding: 14px; gap: 12px; }

    /* Der dreizeilige Maserungs-Hinweis fraß auf dem Handy die Höhe,
       die das Brett braucht. Er bleibt lesbar, nur kompakter. */
    /* v2.7.1: Der Maserungstext steht jetzt unten über dem Button — hier
       bleibt nur noch die Passt-nicht-Warnung, die kompakt sein darf. */
    .dk-fit-warning { font-size: 12px; padding: 7px 9px; }

    /* Sprechblase auf dem Handy etwas schmaler halten */
    .dk-coach { max-width: 200px; font-size: 12px; }

    /* Ausrichtungs-Buttons entfallen mobil — der Text wird direkt mit dem
       Finger positioniert, die Buttons wären doppelt gemoppelt und würden
       eine bereits gesetzte Position wieder überschreiben. */
    .dk-field-align { display: none; }
}

/* Artikel-Zeile: Name links zweizeilig, Preis rechts */
.dk-config-artikel-row {
    align-items: flex-start;
}
.dk-artikel-info {
    flex: 1;
    min-width: 0;
}
.dk-artikel-name {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    display: block;
}
.dk-artikel-preis {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 13px;
    color: #555;
    padding-left: 8px;
}

/* ===== Ausrichtungs-Buttons ===== */
.dk-align-options {
    display: flex;
    gap: 6px;
}
.dk-align-btn {
    width: 40px;
    height: 36px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.15s;
    padding: 0;
}
.dk-align-btn:hover {
    border-color: #c0392b;
    color: #c0392b;
}
.dk-align-btn.active {
    border-color: #c0392b;
    background: #fdf0f0;
    color: #c0392b;
}

/* Gravur-Hinweis im Warenkorb */
.dk-gravur-hinweis {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #b5860d;
    font-weight: 600;
}
.dk-gravur-hinweis::before {
    content: '✏️ ';
}

/* v2.7.4: Handy im Querformat — zweispaltig ist hier richtig (breit, flach),
   aber die linke Spalte muss scrollen können und darf nicht überlaufen. */
@media (max-height: 500px) and (min-width: 681px) {
    .dk-modal-body  { flex-direction: row; }
    .dk-modal-left  { overflow-y: auto; padding: 8px; }
    .dk-modal-right { overflow-y: auto; padding: 12px; }
    .dk-modal       { min-height: 100vh; min-height: 100dvh; border-radius: 0; max-width: none; }
    .dk-modal-overlay { padding: 0; }
}
