.ha-gallery {
    --ha-columns: 4;
    --ha-mobile-columns: 1;
    --ha-gap: 16px;
    --ha-height: 320px;
    --ha-mobile-height: 240px;
    position: relative;
    margin: 1.5rem 0;
}
.ha-gallery *, .ha-lightbox-overlay * { box-sizing: border-box; }
.ha-gallery.ha-has-fixed-frame-height { overflow: auto; }

.ha-gallery.ha-shadow-soft .ha-gallery-item { box-shadow: 0 8px 24px rgba(86, 47, 92, 0.12); }
.ha-gallery.ha-shadow-medium .ha-gallery-item { box-shadow: 0 10px 28px rgba(86, 47, 92, 0.18); }
.ha-gallery.ha-shadow-strong .ha-gallery-item { box-shadow: 0 14px 34px rgba(86, 47, 92, 0.24); }

.ha-gallery-item {
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #f7e8f3 100%);
    position: relative;
}
.ha-item-link, .ha-item-no-link { display: block; position: relative; color: inherit; text-decoration: none; }
.ha-gallery-item img {
    width: 100%;
    height: var(--ha-height);
    display: block;
    object-fit: cover;
    object-position: center center;
    transition: transform .35s ease, opacity .45s ease, transform .45s ease;
}
.ha-zoom-enabled .ha-gallery-item:hover img { transform: scale(1.08); }

.layout-grid .ha-gallery-inner {
    display: grid; grid-template-columns: repeat(var(--ha-columns), minmax(0, 1fr)); gap: var(--ha-gap);
}
.layout-slideshow .ha-gallery-inner {
    position: relative; min-height: var(--ha-height);
}
.layout-slideshow .ha-gallery-item {
    position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .45s ease, transform .45s ease;
}
.layout-slideshow .ha-gallery-item.is-active {
    opacity: 1; pointer-events: auto; position: relative;
}
.layout-carousel .ha-gallery-inner {
    display: grid; grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--ha-gap) * (var(--ha-columns) - 1))) / var(--ha-columns));
    gap: var(--ha-gap); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin;
}
.layout-carousel .ha-gallery-item { scroll-snap-align: start; }
.layout-masonry .ha-gallery-inner { columns: 3 260px; column-gap: var(--ha-gap); }
.layout-masonry .ha-gallery-item { display: inline-block; width: 100%; margin: 0 0 var(--ha-gap); }

.ha-filter-bar {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.ha-filter-btn {
    border: 0; background: #f3e4f3; color: #6a466f; border-radius: 999px; padding: .55rem .85rem; cursor: pointer;
}
.ha-filter-btn.is-active {
    background: #9b669c; color: #fff;
}

.ha-badge {
    position: absolute; top: 12px; left: 12px; z-index: 4; background: #fff; color: #8a4d8d;
    border-radius: 999px; padding: .4rem .7rem; font-size: .8rem; font-weight: 700; box-shadow: 0 4px 10px rgba(0,0,0,.12);
}
.ha-item-overlay {
    position: absolute; inset: auto 0 0 0; padding: 16px;
    background: linear-gradient(180deg, rgba(26, 9, 31, 0.02) 0%, rgba(26, 9, 31, 0.68) 60%, rgba(26, 9, 31, 0.84) 100%);
    color: #fff; opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
.ha-hover-overlay-enabled .ha-gallery-item:hover .ha-item-overlay,
.ha-hover-overlay-enabled .ha-gallery-item:focus-within .ha-item-overlay { opacity: 1; transform: translateY(0); }
.ha-overlay-title { font-weight: 700; margin-bottom: 6px; }
.ha-overlay-price { font-size: .95rem; margin-bottom: 10px; color: #f8d9f2; }
.ha-overlay-button, .ha-overlay-secondary {
    display: inline-block; padding: .55rem .8rem; border-radius: 999px; margin-right: 8px; margin-top: 6px;
    background: #fff; color: #7e4d8a; font-weight: 600; font-size: .9rem; text-decoration: none;
}
.ha-overlay-secondary { background: rgba(255,255,255,.18); color: #fff; }

.ha-item-caption { padding: 10px 12px 12px; font-size: .95rem; color: #5b4661; background: #fff; }

.ha-shimmer-enabled .ha-gallery-item::after {
    content: ""; position: absolute; top: 0; left: -130%; width: 70%; height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.24), rgba(255,255,255,0));
    transform: skewX(-20deg); pointer-events: none; animation: haShimmer 3.8s infinite;
}
@keyframes haShimmer {
    0% { left: -130%; }
    100% { left: 170%; }
}

.ha-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 46px; height: 46px; border: 0; border-radius: 999px;
    background: rgba(255,255,255,0.92); color: #74477e; box-shadow: 0 6px 18px rgba(0,0,0,.15); font-size: 28px; line-height: 1; cursor: pointer;
}
.ha-prev { left: 12px; } .ha-next { right: 12px; }
.ha-slideshow-dots { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.ha-dot { width: 12px; height: 12px; border: 0; border-radius: 999px; background: #d7bfd9; cursor: pointer; }
.ha-dot.is-active { background: #9b669c; }

.ha-lightbox-overlay, .ha-quickview-modal {
    position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center;
}
.ha-lightbox-overlay.is-open, .ha-quickview-modal.is-open { display: flex; }
.ha-lightbox-backdrop, .ha-quickview-backdrop { position: absolute; inset: 0; background: rgba(22, 12, 28, 0.82); }
.ha-lightbox-image { position: relative; z-index: 2; max-width: min(92vw, 1200px); max-height: 88vh; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); background: #fff; }
.ha-lightbox-close, .ha-quickview-close {
    position: absolute; top: 18px; right: 18px; z-index: 3; width: 42px; height: 42px; border: 0; border-radius: 999px; background: #fff; color: #5a3460; font-size: 28px; line-height: 1; cursor: pointer;
}
.ha-quickview-card {
    position: relative; z-index: 2; width: min(92vw, 900px); background: #fff; border-radius: 22px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,.28); display: grid; grid-template-columns: 1.1fr 1fr;
}
.ha-quickview-image { width: 100%; height: 100%; min-height: 360px; object-fit: cover; display: block; }
.ha-quickview-content { padding: 24px; }
.ha-quickview-title { margin: 0 0 8px; }
.ha-quickview-price { color: #8a4d8d; font-weight: 700; margin-bottom: 12px; }
.ha-quickview-text { color: #5b4661; }
.ha-quickview-actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }
.ha-quickview-link, .ha-quickview-add {
    display: inline-block; padding: .7rem 1rem; border-radius: 999px; background: #8f5e95; color: #fff; text-decoration: none;
}
.ha-quickview-add { background: #e9d7ea; color: #6b3b72; }

/* editor */
.ha-v81-editor-wrap { margin-top: 12px; }
.ha-editor-note { margin: 0 0 12px; }
.ha-help-text { color: #6b5a70; margin: 0 0 12px; font-size: 13px; }
.ha-thumb-selector-wrap, .ha-selected-image-editor {
    margin-top: 20px; background: linear-gradient(180deg, #fff 0%, #f7e8f3 100%);
    border-radius: 22px; box-shadow: 0 8px 24px rgba(86, 47, 92, 0.12); padding: 16px;
}
.ha-thumb-selector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px; margin-top: 12px; }
.ha-thumb-select {
    border: 2px solid #eadcf7; background: #fff; border-radius: 16px; overflow: hidden; cursor: grab; padding: 0;
    box-shadow: 0 6px 18px rgba(86, 47, 92, 0.10);
}
.ha-thumb-select.is-selected { border-color: #9b669c; box-shadow: 0 0 0 2px rgba(155, 102, 156, 0.18), 0 6px 18px rgba(86, 47, 92, 0.12); }
.ha-thumb-select-image { width: 100%; height: 88px; object-fit: cover; display: block; }
.ha-selected-image-header { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.ha-selected-image-preview { width: 84px; height: 84px; border-radius: 16px; object-fit: cover; display: block; }
.ha-selected-image-sub { font-size: 12px; color: #6b5a70; margin-top: 3px; }

.ha-editor-slideshow-box {
    position: relative; background: linear-gradient(180deg, #fff 0%, #f7e8f3 100%); box-shadow: 0 8px 24px rgba(86, 47, 92, 0.12);
}
.ha-editor-slideshow-box .ha-gallery-item { margin: 0; }
.ha-editor-slideshow-box .ha-slideshow-dots { position: absolute; left: 0; right: 0; bottom: 12px; margin-top: 0; z-index: 6; }
.ha-editor-dots .ha-dot { box-shadow: 0 2px 8px rgba(0,0,0,.15); }

@media (max-width: 900px) {
    .layout-grid .ha-gallery-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-carousel .ha-gallery-inner { grid-auto-columns: calc((100% - var(--ha-gap)) / 2); }
    .layout-masonry .ha-gallery-inner { columns: 2 180px; }
    .ha-quickview-card { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .layout-grid .ha-gallery-inner { grid-template-columns: repeat(var(--ha-mobile-columns), minmax(0, 1fr)); }
    .layout-carousel .ha-gallery-inner { grid-auto-columns: calc((100% - (var(--ha-gap) * (var(--ha-mobile-columns) - 1))) / var(--ha-mobile-columns)); }
    .layout-masonry .ha-gallery-inner { columns: 1; }
    .ha-nav { width: 40px; height: 40px; font-size: 24px; }
    .ha-gallery-item img { height: var(--ha-mobile-height); }
}
