/* x-Sight Personalisierer: Storefront (Produktseite, Warenkorb). Der Editor bringt eigene Stile mit. */
html.xp-open, html.xp-open body { overflow: hidden; }
.xp-host { position: fixed; inset: 0; z-index: 2000; }

.xp-loading { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; background: rgba(20, 16, 10, .35); }
.xp-loading-box { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: #fff; color: #1f1a14; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-weight: 600; }
.xp-loading-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #e6e3de; border-top-color: var(--bs-primary, #ea6a0c); animation: xp-spin .8s linear infinite; }
@keyframes xp-spin { to { transform: rotate(360deg); } }

.xp-buy-hint { font-size: .875rem; color: var(--bs-secondary-color, #6e6e73); margin: .5rem 0 0; }
.btn-xp-design { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }

/* "Jetzt gestalten" auf der Produktseite: gross und auffaellig, mit kurzem Glanz als Blickfang */
.buy-widget .btn-xp-design {
    position: relative; overflow: hidden; min-height: 52px; font-size: 1.05rem; font-weight: 700;
    letter-spacing: .02em; box-shadow: 0 6px 18px rgba(234, 106, 12, .35);
}
.buy-widget .btn-xp-design svg { width: 20px; height: 20px; flex: none; }
.buy-widget .btn-xp-design::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: skewX(-20deg); animation: xp-shine 3.6s ease-in-out 1s infinite;
}
.buy-widget .xp-quick .btn { min-height: 48px; font-weight: 700; }
.buy-widget .xp-quick .btn-primary { min-height: 52px; box-shadow: 0 6px 18px rgba(234, 106, 12, .3); }
@keyframes xp-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .buy-widget .btn-xp-design::after { animation: none; display: none; } }

/*
 Menge + "Jetzt gestalten": auf dem Handy war die Spalte fuer die Menge (col-4) zu schmal fuer
 Minus, Zahl, Plus und Einheit ("Set"/"Sets"), die Einheit rutschte unter das Feld. Hier stehen
 Menge und Knopf untereinander, jeweils in voller Breite.
*/
.buy-widget-container:has([data-xp-open], [data-xp-quick]) > fieldset.col-4 { align-items: flex-start; }
.buy-widget-container:has([data-xp-open], [data-xp-quick]) .quantity-selector-group { flex-wrap: nowrap; height: auto; align-self: flex-start; }
.buy-widget-container:has([data-xp-open], [data-xp-quick]) .quantity-selector-group > * { height: auto; min-height: 48px; }
.buy-widget-container:has([data-xp-open], [data-xp-quick]) .js-quantity-selector-unit { white-space: nowrap; min-width: 3.5em; justify-content: center; }
.buy-widget-container:has([data-xp-open], [data-xp-quick]) .quantity-selector-group-input { min-width: 2.5em; text-align: center; }
/* Menge oben, darunter Schnellformular bzw. "Jetzt gestalten" in voller Breite */
.buy-widget-container:has([data-xp-open], [data-xp-quick]) > fieldset.col-4,
.buy-widget-container:has([data-xp-open], [data-xp-quick]) > .col-8 { flex: 0 0 100%; max-width: 100%; width: 100%; }
.buy-widget-container:has([data-xp-open], [data-xp-quick]) > fieldset.col-4 { justify-content: flex-start !important; }
.buy-widget-container:has([data-xp-open], [data-xp-quick]) .quantity-selector-group { width: 100%; max-width: 320px; }
.buy-widget-container:has([data-xp-open], [data-xp-quick]) .quantity-selector-group .btn { flex: 0 0 52px; }
@media (max-width: 991.98px) {
    .buy-widget-container:has([data-xp-open], [data-xp-quick]) .quantity-selector-group { max-width: none; }
}

/*
 Badges personalisierbarer Produkte ("Personalisierbar" und der Text aus dem Reiter "Personalisierung"):
 immer im Orange des Shops wie das Theme-Badge (xsight-badge), nebeneinander statt untereinander.
*/
.product-badges:has(.xp-badge, .xp-design-badge) { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 6px; max-width: calc(100% - 8px); }
.product-badges:has(.xp-badge, .xp-design-badge) .badge { margin: 0; }
.product-badges .xp-badge,
.xp-design-badge {
    display: inline-flex; align-items: center; gap: .35em; width: auto; max-width: 100%;
    background: #ff7a29; color: #121010; font-weight: 700; white-space: nowrap;
}
.product-badges .xp-badge::before,
.xp-design-badge::before { content: ""; flex: none; width: .85em; height: .85em; background: currentColor; }
.product-badges .xp-badge::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.xp-design-badge::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z'/%3E%3C/svg%3E") center / contain no-repeat; }
/* in schmalen Kacheln (Handy) kleiner, damit beide moeglichst in eine Zeile passen */
@media (max-width: 575.98px) {
    .product-badges .xp-badge,
    .xp-design-badge { font-size: .75rem; height: 1.6rem; line-height: 1.6rem; padding: 0 5px; gap: .3em; }
    .product-badges:has(.xp-badge, .xp-design-badge) { gap: 4px; }
    .xp-badge-detail { top: 8px; left: 8px; }
}
/* Produktseite: ueber der Galerie */
.gallery-slider:has(> .xp-badge-detail) { position: relative; }
.xp-badge-detail { position: absolute; top: 12px; left: 12px; z-index: 6; pointer-events: none; margin: 0; }
/* "Personalisierbar" unten rechts im Produktbild (Listen, Slider, Produktseite), damit es sich nicht mit den
   Badges oben links (Rabatt, Kampagne, Neu) stapelt */
.xp-badge-corner { position: absolute; right: 8px; bottom: 8px; z-index: 2; margin: 0; pointer-events: none; }
.gallery-slider:has(> .xp-badge-corner-detail) { position: relative; }
.xp-badge-corner-detail { position: absolute; right: 12px; bottom: 36px; top: auto; left: auto; z-index: 6; pointer-events: none; margin: 0; }
.xp-badge-corner-detail .badge { margin: 0; }
@media (max-width: 575.98px) {
    .xp-badge-corner { right: 6px; bottom: 6px; }
    .xp-badge-corner-detail { right: 8px; }
}

/* Warenkorb-Position */
.line-item-xsight-personalized .xp-li-previews { display: flex; gap: 4px; position: relative; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
.line-item-xsight-personalized .xp-li-previews:focus-visible { outline: 2px solid var(--bs-primary, #ea6a0c); outline-offset: 2px; border-radius: 6px; }
.xp-li-zoom { position: absolute; right: 4px; bottom: 4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: var(--bs-primary, #ea6a0c); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.line-item-xsight-personalized .xp-li-previews img { width: 100%; max-width: 110px; border-radius: 6px; background: #f6f5f2; }
.line-item-xsight-personalized .xp-li-previews img + img { max-width: 52px; }
.is-offcanvas.line-item-xsight-personalized .xp-li-previews img { max-width: 80px; }
.xp-li-surfaces { list-style: none; padding: 0; margin: .25rem 0 0; font-size: .8125rem; color: var(--bs-secondary-color, #6e6e73); }
.xp-li-surfaces li { display: flex; gap: .5rem; justify-content: space-between; }
.xp-li-surfaces li span:first-child { overflow: hidden; text-overflow: ellipsis; }
.xp-li-edit { display: inline-flex; align-items: center; gap: .35rem; margin-top: .35rem; padding: .2rem .7rem; border-radius: 999px; border: 0; background: rgba(234, 106, 12, .1); color: var(--bs-primary, #ea6a0c); font-size: .8125rem; font-weight: 700; }
.xp-li-edit:hover { background: rgba(234, 106, 12, .18); }

/* Grosse Vorschau (Popup) */
.xp-pv { position: fixed; inset: 0; z-index: 2050; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 16, 10, .6); }
.xp-pv-box { position: relative; width: min(820px, 100%); max-height: 94dvh; overflow-y: auto; background: #fff; color: #1d1d1f; border-radius: 16px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 12px; }
.xp-pv-title { margin: 0 40px 0 0; font-size: 1.05rem; font-weight: 700; color: #1d1d1f; line-height: 1.3; }
.xp-pv-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1efeb; color: #1d1d1f; display: grid; place-items: center; }
.xp-pv-img { width: 100%; height: auto; border-radius: 10px; background: #f6f5f2; }
.xp-pv-thumbs { display: flex; gap: 8px; }
.xp-pv-thumbs:empty { display: none; }
.xp-pv-thumbs button { width: 72px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; overflow: hidden; }
.xp-pv-thumbs button.active { border-color: var(--bs-primary, #ea6a0c); }
.xp-pv-thumbs img { width: 100%; display: block; }
.xp-pv-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.xp-pv-actions .btn { display: inline-flex; align-items: center; gap: .45rem; }
@media (max-width: 480px) { .xp-pv-actions .btn { flex: 1; justify-content: center; } }

/* Kundenkonto > Meine Designs */
.xp-acc-list { display: flex; flex-direction: column; gap: 12px; margin: 1rem 0 0; }
.xp-acc-item { display: grid; grid-template-columns: 140px 1fr auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--bs-border-color, #e6e3de); border-radius: 12px; }
.xp-acc-img img { width: 100%; border-radius: 8px; background: #f6f5f2; display: block; }
.xp-acc-zoom { padding: 0; border: 0; background: none; width: 100%; cursor: zoom-in; }
.xp-acc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.xp-acc-name { overflow: hidden; text-overflow: ellipsis; }
.xp-acc-product, .xp-acc-date { color: var(--bs-secondary-color, #6e6e73); font-size: .875rem; }
.xp-acc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.xp-acc-actions form { margin: 0; }
@media (max-width: 576px) {
    .xp-acc-item { grid-template-columns: 96px 1fr; }
    .xp-acc-actions { grid-column: 1 / -1; justify-content: stretch; }
    .xp-acc-actions > * { flex: 1; }
    .xp-acc-actions .btn { width: 100%; }
}

/* Personalisierbare Produkte: kein Express-Kauf ohne Design (PayPal-Express im Kaufformular) */
form.buy-widget:has([data-xp-quick], [data-xp-open]) [data-swag-paypal-express-button],
form.buy-widget:has([data-xp-quick], [data-xp-open]) .swag-paypal-express-button { display: none !important; }

/* Teilen-Link */
.xp-shared { max-width: 760px; padding-top: 2rem; padding-bottom: 3rem; }
.xp-shared-intro { opacity: .8; }
.xp-shared-imgs { display: grid; gap: 12px; margin: 1rem 0 1.5rem; }
.xp-shared-imgs img { width: 100%; border-radius: 12px; background: #f6f5f2; }
.xp-proof-form { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 1rem; }
.xp-proof-changes { width: 100%; }
.xp-proof-changes > summary { list-style: none; cursor: pointer; }
.xp-proof-changes > summary::-webkit-details-marker { display: none; }
.xp-share-msg { display: block; margin-top: 6px; font-size: .8125rem; }

/*
 Produktseite unten: "Projekte und Vorlagen" (oeffentliche Vorlagen). Runde Ecken, Vorschau grau und erst beim
 Ueberfahren/Fokus farbig (wie die Kacheln im x-Sight-Theme). Farben aus dem jeweiligen Theme (Bootstrap-Variablen).
*/
.xp-gallery { margin-top: 2.5rem; margin-bottom: 2.5rem; }
.xp-gallery[hidden] { display: none; }
.xp-gallery-title { margin-bottom: .35rem; }
.xp-gallery-lead { margin-bottom: 1.25rem; color: var(--bs-secondary-color, #6c757d); }
.xp-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.xp-gallery-card { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.xp-gallery-media {
    position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px;
    background: rgba(128, 128, 128, .14); border: 1px solid rgba(128, 128, 128, .22);
}
.xp-gallery-preview {
    display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer;
}
.xp-gallery-preview svg {
    display: block; width: 100%; height: 100%;
    filter: grayscale(1) contrast(1.05); transition: filter 250ms ease, transform 250ms ease;
}
.xp-gallery-card:hover .xp-gallery-preview svg,
.xp-gallery-card:focus-within .xp-gallery-preview svg { filter: none; transform: scale(1.03); }
.xp-gallery-preview:focus-visible { outline: none; }
.xp-gallery-card:has(.xp-gallery-preview:focus-visible) .xp-gallery-media { outline: 2px solid var(--bs-primary, #ea6a0c); outline-offset: 2px; }
/* oranger Knopf: Vorlage gleich im Designer oeffnen */
.xp-gallery-design {
    position: absolute; right: 8px; bottom: 8px; z-index: 1;
    display: inline-flex; align-items: center; gap: .35em; height: 2rem; padding: 0 .7rem;
    border: 0; border-radius: 999px; background: #ff7a29; color: #121010; font-weight: 700; font-size: .85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25); cursor: pointer; transition: transform 150ms ease, background 150ms ease;
}
.xp-gallery-design:hover { background: #ff8f4d; transform: translateY(-1px); }
.xp-gallery-design:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.xp-gallery-name {
    padding: 0; border: 0; background: none; color: inherit; text-align: left;
    font-weight: 600; line-height: 1.3; cursor: pointer;
}
.xp-gallery-card:hover .xp-gallery-name { color: var(--bs-primary, #ea6a0c); }
@media (hover: none) {
    /* Touch: kein Ueberfahren, dort gleich farbig */
    .xp-gallery-preview svg { filter: none; }
}
@media (max-width: 575.98px) {
    .xp-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .xp-gallery-design { right: 6px; bottom: 6px; height: 1.75rem; padding: 0 .55rem; font-size: .75rem; }
}
.xp-tpl-pv-view { border-radius: 12px; overflow: hidden; background: #f3f1ed; }
.xp-tpl-pv-view svg { display: block; width: 100%; height: auto; max-height: 60vh; }
.xp-tpl-pv-thumb { width: 72px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #f3f1ed; }
.xp-tpl-pv-thumb.active { border-color: #ff7a29; }
.xp-tpl-pv-thumb svg { display: block; width: 100%; height: auto; }
.xp-tpl-pv-side { margin: .5rem 0 0; font-weight: 600; text-align: center; color: #1f1a14; }
.xp-tpl-pv-hint { margin: .75rem 0 0; font-size: .9rem; color: #5f574e; text-align: center; }
