/*
 * ArtVault for Elementor — Gallery Styles
 * All colors/typography are intentionally minimal defaults.
 * Elementor Style Tab controls override these via inline CSS.
 */

/* ── Reset & Variables ──────────────────────────────────────────────────── */
.artvault-gallery-widget,
.artvault-archive-main,
.artvault-single-main {
  --av-gap:        16px;
  --av-columns:    3;
  --av-radius:     4px;
  --av-badge-sold: #c0392b;
  --av-badge-res:  #e67e22;
  --av-transition: 0.3s ease;
  box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }

/* ── Toolbar ─────────────────────────────────────────────────────────────
 *
 * Layout is driven entirely by CSS custom properties injected as an inline
 * style by the PHP render() method — so behaviour is always correct on first
 * load, with no dependency on Elementor having saved/generated CSS for the
 * widget's responsive controls.
 *
 * PHP injects these vars on .artvault-toolbar:
 *   --av-dir-desktop / --av-dir-tablet / --av-dir-mobile  → row | column
 *   --av-fa-desktop  / --av-fa-tablet  / --av-fa-mobile   → flex-start | center | flex-end  (filter align)
 *   --av-sa-desktop  / --av-sa-tablet  / --av-sa-mobile   → flex-start | center | flex-end  (stacked align)
 *
 * Elementor's own selectors (toolbar_direction, filter_align, stacked_align)
 * still work as live-preview overrides inside the editor.
 *
 * Row mode:  breadcrumbs left (shrink) | filter middle (grow) | sort right (shrink)
 * Column mode: all children full-width, stacked vertically; align-items from --av-sa-*
 * ────────────────────────────────────────────────────────────────────────── */

.artvault-toolbar {
  display: flex;
  flex-direction: var(--av-dir-desktop, row);
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

/* ── Row mode: slot sizing ─────────────────────────────────────────────── */
.artvault-toolbar .artvault-breadcrumbs { flex: 0 0 auto; }
.artvault-toolbar .artvault-filter      { flex: 1 1 auto; }
.artvault-toolbar .av-sort__wrap        { flex: 0 0 auto; }

/* ── Column mode structural rules ────────────────────────────────────────
 * Triggered in the Elementor editor by toolbar_direction selector which sets
 * flex-direction: column directly on the toolbar element via inline style.
 * On the frontend the scoped <style> block in PHP render() sets flex-direction
 * via the toolbar's unique #id — these rules handle the editor preview only.
 *
 * Alignment (justify-content) is NOT set here — it is handled exclusively by:
 *   - Frontend: PHP scoped <style> block with #id specificity (1,0,0)
 *   - Editor:   stacked_align / filter_align Elementor selectors (0,2,0)     */

/* Editor: when Elementor sets flex-direction:column via toolbar_direction selector,
   stretch children to full width so stacked layout works in the preview.
   The [data-av-tb] scoped style block (specificity 0,1,1) sets flex-direction;
   Elementor selector (0,2,0) overrides justify-content for live preview. */
.artvault-toolbar[style*="flex-direction: column"] {
  align-items: stretch;
}
.artvault-toolbar[style*="flex-direction: column"] .artvault-breadcrumbs,
.artvault-toolbar[style*="flex-direction: column"] .artvault-filter,
.artvault-toolbar[style*="flex-direction: column"] .av-sort__wrap {
  flex: 0 0 100%;
  width: 100%;
}

.artvault-toolbar--separator {
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 24px;
  margin-bottom: 24px;
}

/* ── Filter bar ──────────────────────────────────────────────────────────
 * Base display only — no justify-content here.
 * justify-content is set by the PHP scoped <style> block (frontend)
 * or by Elementor filter_align selector (editor preview).               */
.artvault-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* PHP class fallbacks — lowest priority, only for non-toolbar contexts */
.artvault-filter--left   { justify-content: flex-start; }
.artvault-filter--center { justify-content: center; }
.artvault-filter--right  { justify-content: flex-end; }

.artvault-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  font-size: 0.8125rem;
  color: #888;
  margin: 0;
}

.artvault-breadcrumbs__item {
  color: inherit;
  text-decoration: none;
}

.artvault-breadcrumbs__item:hover { text-decoration: underline; }

.artvault-breadcrumbs__item--current {
  color: #333;
  font-weight: 500;
}

.artvault-breadcrumbs__sep {
  color: #bbb;
  user-select: none;
}

/* ── Filter Bar ─────────────────────────────────────────────────────────── */
/* ── Shared base: all filter/sort/category buttons across all widgets ────
   .artvault-filter__btn = GalleryGrid filter bar
   .av-sort__btn          = Navigator sort buttons
   .av-cats__btn          = Navigator category buttons          ─────────── */
.artvault-filter__btn,
.av-sort__btn,
.av-cats__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  background: transparent;
  color: #444;
  font-size: .82rem;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}

.artvault-filter__btn:hover:not(.is-active),
.av-sort__btn:hover:not(.is-active),
.av-cats__btn:hover:not(.is-active) {
  background: #f5f5f5;
  border-color: #aaa;
  color: #1a1a1a;
}

.artvault-filter__btn.is-active:not(.av-sort-toggle),
.av-cats__btn.is-active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
  pointer-events: none;
}

/* Sort toggle buttons stay clickable when active — clicking again reverses direction */
.av-sort__btn.is-active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */
/* Layout mode: grid (default) */
.artvault-grid {
  display: grid;
  grid-template-columns: repeat( var(--av-columns, 3), 1fr );
  gap: var(--av-gap);
}


/* Layout mode: justified — items stretch to fill each row */
.artvault-grid--justified {
  display: flex;
  flex-wrap: wrap;
  gap: var(--av-gap);
}
.artvault-grid--justified .artvault-grid-item {
  flex: 1 1 calc( (100% / var(--av-columns, 3)) - var(--av-gap) );
  min-width: 180px;
}

/* Layout mode: masonry — CSS columns (no JS required) */
.artvault-grid--masonry {
  display: block;
  column-count: var(--av-columns, 3);
  column-gap: var(--av-gap);
}
.artvault-grid--masonry .artvault-grid-item {
  break-inside: avoid;
  margin-bottom: var(--av-gap);
  width: 100%;
  display: block;
}
/* Masonry: card and image-wrap shrink to content, never stretch */
.artvault-grid--masonry .artvault-card {
  height: auto;
}
.artvault-grid--masonry .artvault-card__image-wrap {
  height: auto;
  aspect-ratio: unset !important;
}
.artvault-grid--masonry .artvault-card__image-link,
.artvault-grid--masonry .artvault-card__image-btn {
  height: auto;
  display: block;
}
.artvault-grid--masonry .artvault-card__img {
  width: 100%;
  height: auto;
  object-fit: unset;
  display: block;
}

.artvault-grid-item {
  box-sizing: border-box;
  min-width: 0;           /* prevent grid blowout from long content / images */
  transition: opacity 0.4s ease;
}

/* Filtered-out state */
.artvault-grid-item.is-hidden {
  display: none;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.artvault-card {
  border-radius: var(--av-radius);
  background: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease,
              background-color 0.3s ease, border-color 0.2s ease;
}

/* ── Status Badge ───────────────────────────────────────────────────────── */
/* Positioned on .artvault-card (position:relative).
   Default: bottom-right. Offset controlled via Elementor "Offset from Edge" slider. */
.artvault-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-block;
  width: max-content;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  z-index: 3;
  pointer-events: none;
}

.artvault-badge--available { background: var(--av-badge-available-bg, #27ae60); color: var(--av-badge-available-text, #fff); }
.artvault-badge--sold     { background: var(--av-badge-sold-bg, #c0392b);     color: var(--av-badge-sold-text, #fff); }
.artvault-badge--reserved { background: var(--av-badge-reserved-bg, #e67e22); color: var(--av-badge-reserved-text, #fff); }

/* ── Aspect ratio helpers ───────────────────────────────────────────────── */
/* NOTE: artvault-ratio-* class is ON .artvault-card__image-wrap itself */
.artvault-card__image-wrap {
  display: block;
  width: 100%;
  overflow: hidden;
  background: #f0f0f0;
  border-radius: var(--av-radius) var(--av-radius) 0 0;
  position: relative;
}

.artvault-card__image-wrap.artvault-ratio-1-1  { aspect-ratio: 1 / 1; }
.artvault-card__image-wrap.artvault-ratio-4-3  { aspect-ratio: 4 / 3; }
.artvault-card__image-wrap.artvault-ratio-3-4  { aspect-ratio: 3 / 4; }
.artvault-card__image-wrap.artvault-ratio-16-9 { aspect-ratio: 16 / 9; }
/* artvault-ratio-free: no aspect-ratio set — image natural height */

/* Link / button fills the image-wrap box */
.artvault-card__image-link,
.artvault-card__image-btn {
  display: flex;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

/* Image fills its parent */
.artvault-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--av-transition);
}

/* Free ratio — image at natural height */
.artvault-card__image-wrap.artvault-ratio-free .artvault-card__image-link,
.artvault-card__image-wrap.artvault-ratio-free .artvault-card__image-btn {
  height: auto;
}
.artvault-card__image-wrap.artvault-ratio-free .artvault-card__img {
  height: auto;
  object-fit: unset;
}

.artvault-card:hover .artvault-card__img {
  transform: scale(1.04);
}

/* Overlay — absolutely covers image-wrap, hidden by default.
   background-color and opacity:1 set on :hover via Elementor selector. */
.artvault-card__overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.artvault-card__no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: #e8e8e8;
  color: #999;
  font-size: 0.875rem;
}

/* ── Card Caption ───────────────────────────────────────────────────────── */
.artvault-card__caption {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Nuke all browser/theme default margins inside the caption.
   !important beats any theme rule (.entry-content p, .wp-block p, etc.) */
.artvault-card__caption p,
.artvault-card__caption h3,
.artvault-card__caption h2,
.artvault-card__caption h4 {
  margin: 0 !important;
  padding: 0 !important;
}

.artvault-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.artvault-card__title a {
  text-decoration: none;
  color: inherit;
}

.artvault-card__title a:hover {
  text-decoration: underline;
}

.artvault-card__price {
  font-size: 0.875rem;
  color: #555;
}

.artvault-card__size,
.artvault-card__medium {
  font-size: 0.8rem;
  color: #888;
}

/* Gap between size and medium — driven by --av-size-medium-gap CSS var
   set via Elementor selectors. Needs !important to beat the caption reset. */
.artvault-card__caption .artvault-card__medium {
  margin-top: var(--av-size-medium-gap, 0px) !important;
}

/* ── Quick View Modal ───────────────────────────────────────────────────── */
.artvault-quickview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.artvault-quickview-modal[aria-hidden="false"] {
  display: flex;
}

.artvault-quickview-modal__inner {
  background: #fff;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 6px;
  position: relative;
  padding: 32px;
}

.artvault-quickview-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  color: #333;
}

/* ── Meta Stack (Widget B) ──────────────────────────────────────────────── */
.artvault-meta-stack {
  display: flex;
  flex-direction: column;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.artvault-meta__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  /* No border here — controlled entirely by the --sep modifier + Elementor selector */
}

/* separator ON: top border on first row, bottom border on all rows */
.artvault-meta__row--sep:first-child { border-top: 1px solid #e8e8e8; }
.artvault-meta__row--sep            { border-bottom: 1px solid #e8e8e8; }

.artvault-meta__label {
  font-weight: 600;
  flex-shrink: 0;
  color: #666;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.artvault-meta__value {
  text-align: right;
  color: #1a1a1a;
}

.artvault-price-divider {
  color: #bbb;
  margin: 0 4px;
}

/* ── Status Pill ────────────────────────────────────────────────────────── */
.artvault-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.artvault-status--available { background: var(--av-status-available-bg, #e9f7ef); color: var(--av-status-available-text, #1e8449); }
.artvault-status--sold      { background: var(--av-status-sold-bg, #fdecea);     color: var(--av-status-sold-text, #c0392b); }
.artvault-status--reserved  { background: var(--av-status-reserved-bg, #fef9e7); color: var(--av-status-reserved-text, #b7770d); }

/* ── Enquire Button ─────────────────────────────────────────────────────── */
.artvault-enquire-wrap {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

/* Gap between enquire btn and WA btn — controlled by wa_btn_gap Elementor control.
   Default 10px via margin-left on the WA button. */
.artvault-enquire-wrap .artvault-wa-btn {
  margin-left: 10px;
}

/* Gap between button row and CF7 drawer below — controlled separately */
.artvault-cf7-drawer {
  margin-top: 0;
}
.artvault-enquire-btn {
  display: inline-block;
  padding: 14px 28px;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color var(--av-transition), opacity var(--av-transition);
  cursor: pointer;
}

.artvault-enquire-btn:hover { opacity: 0.85; }

/* ── WhatsApp Contact Button ─────────────────────────────────────────────── */

/* Icon-only: compact square button, no text */
.artvault-wa-btn--icon-only {
  padding: 10px;
  gap: 0;
}
.artvault-wa-btn--icon-only .artvault-wa-btn__icon {
  width: 22px;
  height: 22px;
}

.artvault-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 20px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid #25D366;
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.artvault-wa-btn:hover {
  background: #1ebe5d;
  border-color: #1ebe5d;
  color: #fff;
  text-decoration: none;
}

.artvault-wa-btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.artvault-enquire-btn--sold     { background: #555; }
.artvault-enquire-btn--reserved { background: #e67e22; }

/* ── Single Artwork ─────────────────────────────────────────────────────── */
.artvault-single {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.artvault-single__image {
  width: 100%;
  height: auto;
  display: block;
}

.artvault-single__title {
  margin: 0 0 24px;
}

.artvault-single__statement {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid #e8e8e8;
}

/* ── Archive Header ─────────────────────────────────────────────────────── */
.artvault-archive-header {
  margin-bottom: 32px;
}

.artvault-archive-title {
  font-size: 2rem;
  margin: 0 0 8px;
}

/* ── CF7 Inline Drawer ──────────────────────────────────────────────────── */
.artvault-cf7-drawer {
  width: 100%;         /* full width forces it to its own flex row */
  flex-basis: 100%;    /* belt-and-suspenders for flex-wrap */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
  order: 10;           /* always after buttons regardless of DOM order */
}

.artvault-cf7-drawer.is-open {
  max-height: 1200px; /* large enough for any form */
  opacity: 1;
  margin-top: 0;
}

/* Style the CF7 form inside the drawer — driven by CSS vars from ArtVault Settings */
.artvault-cf7-drawer .wpcf7 {
  padding: var(--av-cf7-form-padding, 24px);
  background: var(--av-cf7-form-bg, #f9f9f9);
  border: 1px solid var(--av-cf7-form-border-color, #e8e8e8);
  border-radius: var(--av-cf7-form-border-radius, 6px);
}

.artvault-cf7-drawer .wpcf7 p {
  margin: 0 0 var(--av-cf7-field-gap, 12px);
}

/* Labels */
.artvault-cf7-drawer .wpcf7 label,
.artvault-cf7-drawer .wpcf7 .wpcf7-form-control-wrap > label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--av-cf7-label-size, 14px);
  color: var(--av-cf7-label-color, #333);
  font-weight: 500;
}

/* Input fields + textarea + select */
.artvault-cf7-drawer .wpcf7 input[type="text"],
.artvault-cf7-drawer .wpcf7 input[type="email"],
.artvault-cf7-drawer .wpcf7 input[type="tel"],
.artvault-cf7-drawer .wpcf7 input[type="number"],
.artvault-cf7-drawer .wpcf7 textarea,
.artvault-cf7-drawer .wpcf7 select {
  width: 100%;
  padding: var(--av-cf7-input-padding-v, 10px) var(--av-cf7-input-padding-h, 12px);
  border: 1px solid var(--av-cf7-input-border-color, #dddddd);
  border-radius: var(--av-cf7-input-border-radius, 4px);
  font-size: var(--av-cf7-input-font-size, 15px);
  color: var(--av-cf7-input-text-color, #333);
  background: var(--av-cf7-input-bg, #ffffff);
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.artvault-cf7-drawer .wpcf7 input:focus,
.artvault-cf7-drawer .wpcf7 textarea:focus,
.artvault-cf7-drawer .wpcf7 select:focus {
  outline: none;
  border-color: var(--av-cf7-input-focus-color, #1a1a1a);
}

.artvault-cf7-drawer .wpcf7 textarea {
  min-height: var(--av-cf7-textarea-min-height, 100px);
  resize: vertical;
  /* Auto-grow with typed content where supported */
  field-sizing: content;
  overflow-y: hidden;
}

/* Submit button */
.artvault-cf7-drawer .wpcf7 input[type="submit"] {
  padding: var(--av-cf7-btn-padding-v, 12px) var(--av-cf7-btn-padding-h, 24px);
  background: var(--av-cf7-btn-bg, #1a1a1a);
  color: var(--av-cf7-btn-text-color, #ffffff);
  border: none;
  border-radius: var(--av-cf7-btn-border-radius, 4px);
  font-size: var(--av-cf7-btn-font-size, 15px);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  width: auto;
}

.artvault-cf7-drawer .wpcf7 input[type="submit"]:hover {
  background: var(--av-cf7-btn-hover-bg, #333333);
  color: var(--av-cf7-btn-hover-text-color, #ffffff);
}

/* Validation messages */
.artvault-cf7-drawer .wpcf7-response-output {
  margin-top: 12px !important;
  padding: 10px 14px !important;
  border-radius: 4px !important;
  font-size: 0.875rem !important;
  border: none !important;
}

.artvault-cf7-drawer .wpcf7-response-output.wpcf7-mail-sent-ok {
  background: var(--av-cf7-success-bg, #e9f7ef) !important;
  color: var(--av-cf7-success-text, #1e8449) !important;
}

.artvault-cf7-drawer .wpcf7-response-output.wpcf7-validation-errors,
.artvault-cf7-drawer .wpcf7-response-output.wpcf7-mail-sent-ng,
.artvault-cf7-drawer .wpcf7-response-output.wpcf7-spam-blocked {
  background: var(--av-cf7-error-bg, #fdecea) !important;
  color: var(--av-cf7-error-text, #c0392b) !important;
}

/* Field-level validation highlight */
.artvault-cf7-drawer .wpcf7-not-valid {
  border-color: var(--av-cf7-error-text, #c0392b) !important;
}

.artvault-cf7-drawer .wpcf7-not-valid-tip {
  color: var(--av-cf7-error-text, #c0392b) !important;
  font-size: 0.8rem;
  margin-top: 3px;
  display: block;
}

/* ── Editor Notice ──────────────────────────────────────────────────────── */
.artvault-editor-notice {
  background: #fff8dc;
  border: 1px dashed #e6c200;
  padding: 16px;
  border-radius: 4px;
  font-size: 0.875rem;
}

/* ── Grid loading/transition states ─────────────────────────────────────── */

/* Fade-in on page load — smooths the transition between category pages */
.artvault-grid.av-grid--fadein {
  animation: av-grid-fadein 0.3s ease both;
}

@keyframes av-grid-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* When a link-mode filter button is clicked:
   - Dim current cards so visitor knows something is happening
   - Show a spinner on the active filter button */
.artvault-grid.av-grid--navigating {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Spinner on the filter button that was clicked */
.artvault-filter__btn.av-filter-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
  padding-right: 28px !important;
}
.artvault-filter__btn.av-filter-loading::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: av-spin 0.6s linear infinite;
}

@keyframes av-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* ── No Results ─────────────────────────────────────────────────────────── */
.artvault-no-results {
  color: #888;
  font-style: italic;
}

/* ══════════════════════════════════════════════════════════════════════════
   Page Heading Widget  (.av-cat-heading)
   Uses `revert` for all font/color properties so the selected HTML tag
   (h1–h6) inherits the theme's heading styles by default. Elementor's
   Typography control in the Style Tab overrides these when the user
   configures typography explicitly.
   ══════════════════════════════════════════════════════════════════════════ */

.av-cat-heading {
  font: revert;
  color: revert;
  margin: 0;
  padding: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   Category Grid Widget  (.av-cat-*)
   Only structural/layout rules here.
   Colors, typography, hover states from Elementor Style Tab selectors.
   ══════════════════════════════════════════════════════════════════════════ */

/* Grid layout — columns + gap injected via scoped <style> in PHP render() */
.av-cat-grid {
  display: grid; /* columns/gap overridden by scoped style */
}

.av-cat-grid__item {
  min-width: 0;
}

/* ── Card
   display:block + overflow:hidden are set inline in PHP so Elementor
   border/bg/shadow selectors can target .av-cat-card directly.
   transition covers transform (lift), box-shadow, background-color, border-color.
   ─────────────────────────────────────────────────────────────────────────── */
.av-cat-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease,
              background-color 0.3s ease, border-color 0.2s ease;
}

/* ── Image wrap: structural; aspect-ratio + overflow set inline ───────── */
.av-cat-card__image-wrap {
  background: #f0f0f0;
  /* transition for smooth overlay */
}

/* img transition for scale/opacity on hover */
.av-cat-card__img {
  transition: transform 0.4s ease, opacity 0.3s ease;
  /* width/height/object-fit set inline per ratio mode */
}

/* ── Overlay: absolutely inside image-wrap, hidden by default ─────────── */
/* Transition must be on the element itself, not in the selector */
.av-cat-card__overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

/* ── Caption ─────────────────────────────────────────────────────────── */
.av-cat-card__caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Nuke all browser/theme default margins inside the caption */
.av-cat-card__caption p,
.av-cat-card__caption h3,
.av-cat-card__caption h2,
.av-cat-card__caption h4 {
  margin: 0 !important;
  padding: 0 !important;
}

.av-cat-card__name {
  font-size: inherit;
  font-weight: inherit;
  font-style: inherit;
  line-height: inherit;
  font-family: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

.av-cat-card__count {
  margin: 0;
}

.av-cat-card__desc {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.av-cat-card__no-image {
  width: 100%;
  min-height: 160px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.875rem;
}

/* ── Available badge (Category Grid) ────────────────────────────────── */
.av-cat-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 3px;
  background-color: #27ae60;
  color: #fff;
  pointer-events: none;
  z-index: 2;
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────── */
.av-cat-widget {
  display: block;
}

.av-cat-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 20px;
  padding: 0;
  font-size: 0.875rem;
}

/* Border line: class added by PHP when setting is on.
   border-color overridden by Elementor selector. */
.av-cat-breadcrumbs--has-line {
  padding-bottom: 14px;
  border-bottom: 1px solid #dddddd;
}

.av-cat-breadcrumbs__item {
  color: #444;
}

.av-cat-breadcrumbs__item a {
  color: inherit;
  text-decoration: none;
}

.av-cat-breadcrumbs__item a:hover {
  text-decoration: underline;
}

.av-cat-breadcrumbs__item--current {
  color: #888;
}

.av-cat-breadcrumbs__sep {
  color: #bbb;
  padding: 0 6px;
  user-select: none;
}

/* ── ArtworkMeta — Side layout (image + meta) ───────────────────────────── */
.artvault-meta-side {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-start;
}

.artvault-meta-side__image {
  width: 50%;
  flex-shrink: 0;
}

.artvault-meta-side__image img {
  width: 100%;
  height: auto;
  display: block;
}

.artvault-meta-side__meta {
  flex: 1;
  min-width: 240px;
}

/* Stack layout modifier */
.artvault-meta-stack--stack .artvault-meta__row {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.artvault-meta-stack--stack .artvault-meta__value {
  text-align: left;
}

/* ── ArtworkMeta — Breadcrumbs ──────────────────────────────────────────── */
.artvault-meta-breadcrumbs {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.artvault-meta-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.artvault-meta-breadcrumbs a:hover {
  text-decoration: underline;
}

.artvault-meta-breadcrumbs__sep {
  color: #ccc;
}

@media (max-width: 767px) {
  .artvault-meta-side {
    flex-direction: column;
  }
  .artvault-meta-side__image {
    width: 100% !important;
  }
}


/* ── ArtworkMeta — Artwork Title ────────────────────────────────────────── */
.artvault-meta-title {
  margin: 0 0 16px;
  padding: 0;
  line-height: 1.2;
}

/* ── ArtworkMeta — Artist Statement ────────────────────────────────────── */
.artvault-meta-statement {
  margin-bottom: 24px;
}

.artvault-meta-statement__heading {
  margin: 0 0 8px;
  padding: 0;
  line-height: 1.3;
}

.artvault-meta-statement__body {
  line-height: 1.7;
  color: #444;
}

.artvault-meta-statement__body p { margin: 0 0 1em; }
.artvault-meta-statement__body p:last-child { margin-bottom: 0; }

/* ── ArtworkMeta — Table layout (both columns left-aligned) ─────────────── */
.artvault-meta-stack--table .artvault-meta__row {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 0;
  flex-wrap: nowrap;
}

.artvault-meta-stack--table .artvault-meta__label {
  flex: 0 0 35%; /* overridden by scoped <style> from PHP */
  width: 35%;
  text-align: left;
  padding-right: 12px;
}

.artvault-meta-stack--table .artvault-meta__value {
  flex: 1;
  text-align: left;
}

/* ── Gallery Grid — Pagination ──────────────────────────────────────────── */
.artvault-pagination {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  padding: 0;
}

.artvault-pagination .page-numbers,
.artvault-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s, color 0.2s;
  line-height: 1;
}

.artvault-pagination span.current {
  background-color: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.artvault-pagination a:hover {
  background-color: #f5f5f5;
}

/* paginate_links outputs a <ul>, reset it */
.artvault-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.artvault-pagination ul.page-numbers li {
  display: contents;
}

/* Load More */
.artvault-pagination--load-more {
  display: block;
}

.artvault-load-more-btn {
  display: inline-block;
  padding: 10px 32px;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  background: transparent;
  color: #1a1a1a;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  transition: background-color 0.2s, color 0.2s;
}

.artvault-load-more-btn:hover {
  background-color: #1a1a1a;
  color: #fff;
}

.artvault-load-more-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Trigger on single artwork image ────────────────────────────────────── */
.artvault-single__image-wrap {
  position: relative;
  display: inline-block;
  cursor: zoom-in;
}

.artvault-lightbox-trigger {
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.artvault-lightbox-trigger__hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.artvault-lightbox-trigger:hover .artvault-lightbox-trigger__hint,
.artvault-lightbox-trigger:focus .artvault-lightbox-trigger__hint {
  opacity: 1;
}

/* ── Lightbox overlay ───────────────────────────────────────────────────── */
.artvault-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: flex-start;   /* anchor to top so image top is always visible */
  justify-content: center;
  padding-top: 48px;         /* leave room for the close button */
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

.artvault-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.artvault-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.92);
  cursor: zoom-out;
}

/* ── Inner container ────────────────────────────────────────────────────── */
.artvault-lightbox__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 92vh;
  width: 100%;
}

/* ── Close button ───────────────────────────────────────────────────────── */
.artvault-lightbox__close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  z-index: 2;
  opacity: .75;
  transition: opacity .15s;
}

.artvault-lightbox__close:hover { opacity: 1; }

/* ── Zoom wrapper & image ───────────────────────────────────────────────── */
.artvault-lightbox__zoom-wrap {
  overflow: hidden;
  display: flex;
  align-items: flex-start;   /* image starts at top, not middle */
  justify-content: center;
  max-width: 92vw;
  max-height: 80vh;
  width: 100%;
  cursor: zoom-in;
  touch-action: none; /* handled by JS for pinch */
}

.artvault-lightbox__zoom-wrap.is-zoomed {
  cursor: grab;
}

.artvault-lightbox__zoom-wrap.is-zoomed.is-grabbing {
  cursor: grabbing;
}

.artvault-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: top center;
  transition: transform .1s ease-out;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* events handled on wrapper */
  cursor: inherit;      /* inherit zoom-in / grab from wrapper */
}

/* while dragging: no transition */
.artvault-lightbox__zoom-wrap.is-grabbing .artvault-lightbox__img {
  transition: none;
}

/* ── Footer: title + zoom controls ─────────────────────────────────────── */
.artvault-lightbox__footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  margin-top: 14px;
  gap: 16px;
}

.artvault-lightbox__title {
  grid-column: 2;
  color: #fff;
  font-size: .95rem;
  margin: 0;
  opacity: .85;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artvault-lightbox__controls {
  grid-column: 3;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.artvault-lightbox__ctrl {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 4px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  padding: 0;
  line-height: 1;
}

.artvault-lightbox__ctrl:hover {
  background: rgba(255,255,255,.25);
}

/* ── Loading spinner ────────────────────────────────────────────────────── */
.artvault-lightbox__zoom-wrap.is-loading::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: av-lb-spin .7s linear infinite;
}

@keyframes av-lb-spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RELATED ARTWORKS STRIP (ArtworkMeta widget)
   ═══════════════════════════════════════════════════════════════════════════ */

.av-related {
  margin-top: 40px;
}

.av-related__heading {
  margin: 0 0 16px;
  padding: 0;
  line-height: 1.3;
}

.av-related__grid {
  display: grid;
  gap: 12px;
  /* Column count driven by data-count attr — overridden per-count below */
  grid-template-columns: repeat(4, 1fr);
}

/* Adjust columns to match chosen count */
.av-related[data-count="3"] .av-related__grid { grid-template-columns: repeat(3, 1fr); }
.av-related[data-count="4"] .av-related__grid { grid-template-columns: repeat(4, 1fr); }
.av-related[data-count="5"] .av-related__grid { grid-template-columns: repeat(5, 1fr); }
.av-related[data-count="6"] .av-related__grid { grid-template-columns: repeat(6, 1fr); }

.av-related__item {
  display: flex;
  flex-direction: column;
}

.av-related__link {
  display: block;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 1 / 1;
}

.av-related__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  transition: transform .25s ease, opacity .2s;
}

.av-related__item:hover .av-related__img {
  transform: scale(1.04);
  opacity: .92;
}

.av-related__img--placeholder {
  background: #f0f0f0;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.av-related__title {
  display: block;
  margin-top: 8px;
  font-size: .82rem;
  line-height: 1.4;
  color: inherit;
  text-decoration: none;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s;
}

.av-related__title:hover {
  text-decoration: underline;
}

/* Responsive: collapse columns on smaller screens */
@media ( max-width: 600px ) {
  .av-related[data-count="5"] .av-related__grid,
  .av-related[data-count="6"] .av-related__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .av-related[data-count="4"] .av-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ARTVAULT NAVIGATOR WIDGET
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Bar row ─────────────────────────────────────────────────────────────── */
.av-navigator__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */
.av-navigator__breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: .85rem;
  color: #666;
  margin: 0;
}

.av-navigator__breadcrumbs a {
  color: inherit;
  text-decoration: none;
  transition: color .15s;
}

.av-navigator__breadcrumbs a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

.av-navigator__breadcrumbs .av-crumb--current {
  color: #1a1a1a;
  font-weight: 500;
}

.av-navigator__breadcrumbs .av-crumb__sep {
  color: #bbb;
  padding: 0 2px;
  user-select: none;
}

/* ── Sort buttons ────────────────────────────────────────────────────────── */
.av-sort__wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* .av-sort__btn base styles — unified with .artvault-filter__btn above */

/* ── Separator line ──────────────────────────────────────────────────────── */
.av-navigator__sep {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin-top: 16px;
  margin-bottom: 24px;
}

/* ── Responsive: stack on small screens ─────────────────────────────────── */
@media ( max-width: 600px ) {
  .av-navigator__bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Category buttons (Navigator widget) ────────────────────────────────── */
.av-cats__wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* .av-cats__btn base styles — unified with .artvault-filter__btn above */

/* Sort row when both cats + sort are shown */
.av-navigator__bar--sort-row {
  margin-top: 10px;
  justify-content: flex-end;
}

/* ── Quick View modal: meta rows ─────────────────────────────────────────── */
.artvault-quickview__meta {
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.artvault-quickview__meta-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: .88rem;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 8px;
}

.artvault-quickview__meta-row:last-child {
  border-bottom: none;
}

.artvault-quickview__meta-row dt {
  flex: 0 0 72px;
  font-weight: 600;
  color: #888;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.artvault-quickview__meta-row dd {
  margin: 0;
  color: #222;
}

.artvault-quickview__meta-row--price dd {
  font-weight: 600;
  font-size: 1rem;
}

.artvault-quickview__status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  text-transform: capitalize;
}

.artvault-quickview__status--available { background: #e9f7ef; color: #1e8449; }
.artvault-quickview__status--sold      { background: #fdecea; color: #c0392b; }
.artvault-quickview__status--reserved  { background: #fef3e2; color: #d68910; }

/* ═══════════════════════════════════════════════════════════════════════════
   QUICK VIEW — layout, title, button
   ═══════════════════════════════════════════════════════════════════════════ */

.artvault-quickview-layout {
  display: flex;
  flex-direction: row;
  gap: 32px;
  align-items: flex-start;
}

.artvault-quickview-layout__image {
  flex: 0 0 50%;
  overflow: hidden;
  border-radius: 4px;
}

.artvault-quickview-layout__image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.artvault-quickview-layout__info {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.artvault-quickview__title {
  margin: 0 0 16px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1.3;
  color: #111;
}

/* ── View Details button ─────────────────────────────────────────────────── */
.artvault-quickview__btn-wrap {
  display: flex;
  justify-content: flex-start;
  margin-top: 20px;
}

.artvault-quickview__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.artvault-quickview__btn:hover {
  background: #333;
  color: #fff;
}

/* ── Responsive: stack on mobile ─────────────────────────────────────────── */
@media ( max-width: 600px ) {
  .artvault-quickview-layout {
    flex-direction: column;
    gap: 16px;
  }
  .artvault-quickview-layout__image {
    flex: none;
    width: 100%;
  }
  .artvault-quickview-modal__inner {
    padding: 16px;
    max-height: 95vh;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CF7 POPUP MODAL  (.artvault-cf7-modal)
   ═══════════════════════════════════════════════════════════════════════════ */

.artvault-cf7-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999990;
  align-items: center;
  justify-content: center;
}

.artvault-cf7-modal[aria-hidden="false"] {
  display: flex;
}

.artvault-cf7-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  cursor: pointer;
}

.artvault-cf7-modal__box {
  position: relative;
  z-index: 1;
  background: var(--av-cf7-form-bg, #fff);
  border-radius: var(--av-cf7-form-border-radius, 8px);
  padding: var(--av-cf7-form-padding, 32px);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
}

.artvault-cf7-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
  transition: color .15s;
}

.artvault-cf7-modal__close:hover { color: #111; }

.artvault-cf7-modal__body {
  margin-top: 8px;
}

/* Reuse all the CF7 drawer field styles inside the modal box */
.artvault-cf7-modal__body .wpcf7 p            { margin: 0 0 var(--av-cf7-field-gap, 12px); }
.artvault-cf7-modal__body .wpcf7 label        { display:block; margin-bottom:4px; font-size:var(--av-cf7-label-size,14px); color:var(--av-cf7-label-color,#333); font-weight:500; }

.artvault-cf7-modal__body .wpcf7 input[type="text"],
.artvault-cf7-modal__body .wpcf7 input[type="email"],
.artvault-cf7-modal__body .wpcf7 input[type="tel"],
.artvault-cf7-modal__body .wpcf7 input[type="number"],
.artvault-cf7-modal__body .wpcf7 textarea,
.artvault-cf7-modal__body .wpcf7 select {
  width: 100%;
  padding: var(--av-cf7-input-padding-v,10px) var(--av-cf7-input-padding-h,12px);
  border: 1px solid var(--av-cf7-input-border-color,#ddd);
  border-radius: var(--av-cf7-input-border-radius,4px);
  font-size: var(--av-cf7-input-font-size,15px);
  color: var(--av-cf7-input-text-color,#333);
  background: var(--av-cf7-input-bg,#fff);
  transition: border-color .2s;
  box-sizing: border-box;
}

.artvault-cf7-modal__body .wpcf7 input:focus,
.artvault-cf7-modal__body .wpcf7 textarea:focus { outline:none; border-color:var(--av-cf7-input-focus-color,#1a1a1a); }

.artvault-cf7-modal__body .wpcf7 textarea {
  min-height: var(--av-cf7-textarea-min-height,100px);
  resize: vertical;
  field-sizing: content;
  overflow-y: hidden;
}

.artvault-cf7-modal__body .wpcf7 input[type="submit"] {
  padding: var(--av-cf7-btn-padding-v,12px) var(--av-cf7-btn-padding-h,24px);
  background: var(--av-cf7-btn-bg,#1a1a1a);
  color: var(--av-cf7-btn-text-color,#fff);
  border: none;
  border-radius: var(--av-cf7-btn-border-radius,4px);
  font-size: var(--av-cf7-btn-font-size,15px);
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.artvault-cf7-modal__body .wpcf7 input[type="submit"]:hover {
  background: var(--av-cf7-btn-hover-bg,#333);
  color: var(--av-cf7-btn-hover-text-color,#fff);
}

.artvault-cf7-modal__body .wpcf7-response-output {
  margin-top: 12px !important; padding: 10px 14px !important;
  border-radius: 4px !important; border: none !important; font-size: .875rem !important;
}
.artvault-cf7-modal__body .wpcf7-response-output.wpcf7-mail-sent-ok { background:var(--av-cf7-success-bg,#e9f7ef) !important; color:var(--av-cf7-success-text,#1e8449) !important; }
.artvault-cf7-modal__body .wpcf7-response-output.wpcf7-validation-errors,
.artvault-cf7-modal__body .wpcf7-response-output.wpcf7-mail-sent-ng  { background:var(--av-cf7-error-bg,#fdecea) !important; color:var(--av-cf7-error-text,#c0392b) !important; }
.artvault-cf7-modal__body .wpcf7-not-valid { border-color:var(--av-cf7-error-text,#c0392b) !important; }
.artvault-cf7-modal__body .wpcf7-not-valid-tip { color:var(--av-cf7-error-text,#c0392b) !important; font-size:.8rem; margin-top:3px; display:block; }

/* ═══════════════════════════════════════════════════════════════════════════
   SOCIAL SHARING  (.av-social-share)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Social share divider line */
.av-social-share__divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 0;
  padding: 0;
}

.av-social-share {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* overridden by Elementor alignment control */
  gap: 0;
}

.av-social-share__heading {
  font-size: .82rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: 4px;
}

.av-social-share__buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%; /* needed so justify-content has effect */
}

.av-social-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: #1a1a1a;
  text-decoration: none;
  transition: opacity .15s, transform .15s;
  flex-shrink: 0;
}

.av-social-share__btn:hover {
  opacity: .82;
  transform: translateY(-1px);
}

.av-social-share__btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  display: block;
}

/* ── Artwork Carousel ────────────────────────────────────────────────────── */

.av-carousel {
  position: relative;
  width: 100%;
}

/* Viewport clips the overflow */
.av-carousel__viewport {
  overflow: hidden;
  width: 100%;
}

/* Track holds all slides in a flex row */
.av-carousel__track {
  display: flex;
  flex-wrap: nowrap;
}

/* Individual slide */
.av-carousel__slide {
  flex: 0 0 auto;
  box-sizing: border-box;
  /* width and margin-right set by JS via CSS custom properties */
  width: var(--av-c-slide-w, 33.3333%);
  margin-right: var(--av-c-gap, 20px);
}

.av-carousel__slide:last-child {
  margin-right: 0;
}

/* Image wrap */
.av-carousel__image-wrap {
  display: block;
  width: 100%;
  overflow: hidden;
  background: #f2f2f2;
}

.av-carousel__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.av-carousel__image-wrap:hover img {
  transform: scale(1.04);
}

/* Aspect ratio variants */
.av-carousel__image-wrap.ratio-1-1  { aspect-ratio: 1 / 1; }
.av-carousel__image-wrap.ratio-4-3  { aspect-ratio: 4 / 3; }
.av-carousel__image-wrap.ratio-3-4  { aspect-ratio: 3 / 4; }
.av-carousel__image-wrap.ratio-16-9 { aspect-ratio: 16 / 9; }
.av-carousel__image-wrap.ratio-free { aspect-ratio: unset; }

/* Caption */
.av-carousel__caption {
  margin-top: 10px;
}

.av-carousel__title {
  font-size: 0.95em;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 4px;
}

.av-carousel__title-link {
  text-decoration: none;
  color: inherit;
}

.av-carousel__title-link:hover .av-carousel__title {
  text-decoration: underline;
}

.av-carousel__price {
  font-size: 0.85em;
  color: #555;
}

/* ── Arrow buttons ───────────────────────────────────────────────────────── */

.av-carousel__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
  color: #333;
  padding: 0;
  line-height: 1;
}

.av-carousel__arrow:hover {
  background: #f5f5f5;
}

.av-carousel__arrow:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.av-carousel__arrow.is-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Sides position — absolute over slides */
.av-carousel--arrows-sides .av-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

.av-carousel--arrows-sides .av-carousel__arrow--prev {
  left: -20px;
}

.av-carousel--arrows-sides .av-carousel__arrow--next {
  right: -20px;
}

/* Below position */
.av-carousel__arrows-below {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

/* Elementor icon sizing inside arrow */
.av-carousel__arrow i {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.av-carousel__arrow svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* Empty state in editor */
.av-carousel__empty {
  padding: 20px;
  text-align: center;
  color: #999;
  font-style: italic;
  border: 1px dashed #ccc;
  border-radius: 4px;
}
