/* Vanilla Instinct Cake Options - Frontend */

.vico-fields {
    margin: 1.75rem 0;
    padding: 1.5rem;
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    /* Themes rendern form.cart oft als display:flex – ohne flex-basis:100% würde
       unsere Box neben anderen Form-Children landen. */
    flex: 1 0 100%;
    width: 100%;
    box-sizing: border-box;
    order: 0;
}
.vico-fields__title {
    margin: 0 0 1.25rem;
    font-size: 1.15rem;
    font-weight: 600;
}

/* Das gesamte Cart-Form so erzwingen, dass Folge-Elemente (Mengenfeld, Button)
   unterhalb unserer Optionen erscheinen, nicht daneben. */
form.cart .quantity,
form.cart .single_add_to_cart_button {
    flex-basis: auto;
    order: 10;
}

.vico-field {
    margin: 0 0 1.25rem;
}
.vico-field:last-child {
    margin-bottom: 0;
}

/* ----- Toggle-Feld (Aufschrift/Goldzahl/Zuckerbild mit Checkbox) ----- */
.vico-field--toggle {
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.vico-field--toggle:has(.vico-toggle__checkbox:checked),
.vico-field--toggle.is-open {
    border-color: #b8b8b8;
}
.vico-field--toggle.vico-field--required-open {
    border-color: #d9d9d9;
}

.vico-toggle__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.vico-toggle__header:hover {
    background: #f7f7f7;
}
.vico-toggle__checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #111;
}
.vico-toggle__label {
    flex: 1;
    font-weight: 600;
    font-size: 0.98rem;
}
.vico-toggle__price {
    font-weight: 400;
    color: #666;
    font-size: 0.9em;
}
.vico-toggle__chevron {
    color: #888;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.vico-field--toggle:has(.vico-toggle__checkbox:checked) .vico-toggle__chevron {
    transform: rotate(180deg);
}

.vico-toggle__content {
    padding: 0 1rem 1rem;
}
.vico-toggle__content[hidden] {
    display: none;
}

/* Pflichtfeld: Header im gleichen Style wie vorher (ohne Checkbox) */
.vico-field--required-open .vico-field__header {
    padding: 0.85rem 1rem 0.5rem;
}
.vico-field--required-open .vico-toggle__content {
    padding: 0 1rem 1rem;
}
.vico-field__header {
    margin-bottom: 0.6rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.vico-field__label {
    font-weight: 600;
    font-size: 0.98rem;
}
.vico-required {
    color: #c62828;
}
.vico-price-hint {
    font-weight: 400;
    color: #666;
    font-size: 0.9em;
}
.vico-hint {
    display: block;
    margin-top: 0.35rem;
    color: #666;
    font-size: 0.82em;
}

/* ----- Bildkacheln ----- */
.vico-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.6rem;
}
@media (min-width: 600px) {
    .vico-tiles {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
}
.vico-tile {
    position: relative;
    cursor: pointer;
    display: block;
}
.vico-tile input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}
.vico-tile__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.5rem 0.75rem;
    border: 2px solid #e2e2e2;
    border-radius: 8px;
    background: #fff;
    transition: all 0.15s ease;
    height: 100%;
    text-align: center;
}
.vico-tile:hover .vico-tile__inner {
    border-color: #999;
    transform: translateY(-1px);
}
.vico-tile input:focus-visible + .vico-tile__inner {
    outline: 2px solid #5B9BD5;
    outline-offset: 2px;
}
.vico-tile input:checked + .vico-tile__inner {
    border-color: #111;
    box-shadow: 0 0 0 1px #111 inset;
    background: #fff;
}
.vico-tile__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f4f4f4;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}
.vico-tile__inner--no-image {
    justify-content: center;
    padding: 1rem 0.75rem;
}
.vico-tile__label {
    font-size: 0.85rem;
    line-height: 1.25;
    font-weight: 500;
    color: #222;
}
.vico-tile__price {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #666;
}

/* ----- Textfeld (Aufschrift) ----- */
.vico-text-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font: inherit;
}
.vico-text-input:focus {
    outline: 2px solid #5B9BD5;
    outline-offset: 1px;
}

/* ----- Beispielbild (Aufschrift/Goldzahl/Zuckerbild) ----- */
.vico-example {
    margin: 0 0 0.85rem;
    padding: 0;
    display: inline-block;
}
.vico-example-image {
    display: block;
    max-width: 240px;
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 6px;
    border: 1px solid #eaeaea;
    background: #fff;
}
.vico-example-caption {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #888;
    text-align: center;
    letter-spacing: 0.03em;
}

/* ----- Gold-Input: zentriert, Monospace, größer ----- */
.vico-gold-input {
    text-align: center;
    letter-spacing: 0.2em;
    font-weight: 600;
    font-size: 1.15rem;
    max-width: 180px;
}

/* ----- Upload-Dropzone ----- */
.vico-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.25rem 1rem;
    border: 2px dashed #c8c8c8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    text-align: center;
}
.vico-upload-dropzone:hover {
    border-color: #888;
    background: #fcfcfc;
}
.vico-upload-dropzone input[type="file"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}
.vico-upload-icon {
    font-size: 1.4rem;
    color: #888;
}
.vico-upload-text {
    font-weight: 500;
    font-size: 0.95rem;
}
.vico-upload-filename {
    color: #444;
    font-size: 0.85rem;
    min-height: 1em;
}
.vico-upload-dropzone.has-file {
    border-color: #2e7d32;
    background: #f3f9f4;
}

/* ----- Preis-Zusammenfassung ----- */
.vico-summary {
    margin-top: 1.5rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
}
.vico-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.3rem 0;
    font-size: 0.92rem;
}
.vico-summary__row--base {
    color: #444;
}
.vico-summary__row--extra {
    color: #666;
    font-size: 0.88rem;
    padding: 0.2rem 0;
}
.vico-summary__row--extra .vico-summary__label {
    padding-left: 0.75rem;
    position: relative;
}
.vico-summary__row--extra .vico-summary__label::before {
    content: '›';
    position: absolute;
    left: 0;
    color: #999;
}
.vico-summary__row--total {
    border-top: 1px solid #eaeaea;
    margin-top: 0.4rem;
    padding-top: 0.6rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: #111;
}
.vico-summary__label {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}
.vico-summary__value {
    white-space: nowrap;
    flex-shrink: 0;
}
.vico-summary__lines {
    margin: 0;
}
.vico-summary__lines:empty {
    display: none;
}

/* ----- Nährwert-Tabelle im Frontend-Tab ----- */
.vico-nutrition-reference {
    margin: 0 0 0.75rem;
    color: #666;
    font-size: 0.9rem;
}
.vico-nutrition-fact-table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
}
.vico-nutrition-fact-table th,
.vico-nutrition-fact-table td {
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid #ececec;
    text-align: left;
    vertical-align: top;
}
.vico-nutrition-fact-table th {
    font-weight: 500;
    color: #333;
    width: 60%;
}
.vico-nutrition-fact-table td {
    color: #111;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.vico-nutrition-fact-table tr.is-indented th {
    padding-left: 1.9rem;
    font-weight: 400;
    color: #666;
    font-size: 0.92rem;
    position: relative;
}
.vico-nutrition-fact-table tr.is-indented th::before {
    content: '›';
    position: absolute;
    left: 0.9rem;
    color: #bbb;
}
.vico-nutrition-fact-table tr:last-child th,
.vico-nutrition-fact-table tr:last-child td {
    border-bottom: 0;
}

/* ----- Allergene-Tab ----- */
.vico-allergens-intro {
    margin-bottom: 1.25rem;
    color: #444;
}
.vico-allergens-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 900px;
}
@media (min-width: 680px) {
    .vico-allergens-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.vico-allergens-col h3 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    font-weight: 600;
    color: #222;
}
.vico-allergens-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.vico-allergens-list li {
    padding: 0.35rem 0;
    font-size: 0.95rem;
    color: #333;
}
.vico-allergens-code {
    display: inline-block;
    min-width: 2em;
    font-weight: 600;
    color: #111;
    margin-right: 0.35em;
}

/* Responsive: kompaktere Kachel-Innenpadding auf Mobile */
@media (max-width: 480px) {
    .vico-tile__inner {
        padding: 0.5rem 0.35rem 0.6rem;
    }
    .vico-tile__label {
        font-size: 0.8rem;
    }
}

/* ----------------------------------------------------------------
   Farb-Swatch-Auswahl (Typ: color)
   ---------------------------------------------------------------- */
.vico-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.5rem 0;
}
.vico-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}
.vico-swatch input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.vico-swatch__color {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid transparent;
    box-shadow: 0 0 0 1px #ccc;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.vico-swatch input[type="radio"]:checked ~ .vico-swatch__color {
    border-color: #7c5cbf;
    box-shadow: 0 0 0 2px #7c5cbf;
    transform: scale(1.1);
}
.vico-swatch__label {
    font-size: 0.72rem;
    text-align: center;
    color: #555;
    max-width: 56px;
    line-height: 1.2;
}
.vico-swatch__price {
    font-size: 0.68rem;
    color: #7c5cbf;
}

/* ── Textliste-Optionen (TYPE_LIST) ──────────────────────── */
.vico-list-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0;
}
.vico-list-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid #e0dce8;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fff;
}
.vico-list-option:hover {
    border-color: #9B8ABF;
    background: #f7f4fb;
}
.vico-list-option input[type="radio"] {
    flex-shrink: 0;
    accent-color: #9B8ABF;
    width: 16px;
    height: 16px;
    margin: 0;
}
.vico-list-option input[type="radio"]:checked ~ .vico-list-option__label {
    color: #3A3040;
    font-weight: 500;
}
.vico-list-option:has(input:checked) {
    border-color: #9B8ABF;
    background: #f0ecf8;
}
.vico-list-option__label {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.3;
}
.vico-list-option__label .vico-item-price {
    margin-left: 6px;
    font-size: 0.8rem;
    color: #9B8ABF;
}
