.wtb-gallery {
    width: 95%;
    margin: 0 auto 20px;
}

/* WooCommerce legt den Inhaltsbereich einer "Mein Konto"-Seite standardmäßig
   auf ein zweispaltiges Float-Layout fest (Inhalt ~68% neben der Navigation,
   siehe woocommerce-layout.css). Ein "aus dem Container ausbrechen"-Trick auf
   der Galerie selbst (vw-basierte Breite) ignoriert dieses Layout komplett
   und legt sich über die ganze Seite inkl. Menü — deshalb wird stattdessen
   NUR auf Seiten mit einer Mini Galerie das zweispaltige Layout selbst auf
   einspaltig/volle Breite umgeschaltet; alle anderen "Mein Konto"-Unterseiten
   (Bestellungen, Adressen, …) bleiben davon unberührt. */
body:has(.wtb-gallery) .woocommerce-MyAccount-content,
body:has(.wtb-gallery) .woocommerce-MyAccount-navigation {
    float: none;
    width: 100%;
}

.wtb-gallery-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.wtb-gallery-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    color: #50575e;
    cursor: pointer;
}

.wtb-gallery-toggle-btn.is-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.wtb-gallery-toggle-btn .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.wtb-gallery-grid,
.wtb-gallery-list {
    display: none;
}

.wtb-gallery-view-grid .wtb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--wtb-gallery-columns, 4), 1fr);
    gap: 14px;
}

.wtb-gallery-view-list .wtb-gallery-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Raster */
.wtb-gallery-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wtb-gallery-item-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

.wtb-gallery-item-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* Liste */
.wtb-gallery-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.wtb-gallery-row-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.wtb-gallery-row-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wtb-gallery-row-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Aktions-Buttons (Ansehen/Download) — beide Ansichten. "Ansehen" ist ein <a>,
   "Download" bewusst ein <button> (siehe gallery-public.js) — Browser-Vorgaben
   für <button> (Rahmen, Schrift, Innenabstand) daher explizit zurückgesetzt,
   damit beide optisch identisch aussehen. */
.wtb-gallery-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: #f0f0f1;
    color: #50575e;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.wtb-gallery-action:hover {
    background: #2271b1;
    color: #fff;
}

/* Mobil: feste Spaltenzahl automatisch reduzieren, unabhängig von der Einstellung */
@media (max-width: 600px) {
    .wtb-gallery-view-grid .wtb-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
    .wtb-gallery-view-grid .wtb-gallery-grid { grid-template-columns: 1fr; }
}
