/* UMagical Shop R5.12.1 — source-aware homepage video row repair.
   Scoped to #shop-header. Applied LAST in <head> to restore banner layout
   without editing storefront.css, media, Blade partials, carousels, or links.
   Keep the existing 9:16 portrait policy and object-fit:contain. */

#um-app #shop-header.shop-header {
  box-sizing: border-box;
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: min(calc(100% - 2 * clamp(12px, 4vw, 72px)), 1240px) !important;
  max-width: 1240px !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: clamp(12px, 2.2vw, 28px) auto 0 !important;
  padding: clamp(14px, 2.7vw, 30px) clamp(10px, 3vw, 32px) !important;
  gap: clamp(10px, 2vw, 22px) !important;
  border: 1.8px solid var(--outline, #727575) !important;
  border-radius: clamp(18px, 4vw, 42px) !important;
  overflow: visible;
}

#um-app #shop-header.shop-header .logo-area {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  flex: 0 0 auto !important;
  margin: 0 auto !important;
  text-align: center !important;
}

/* Direct descendants of .header-videos are the three independent slots.
   They may be .video tiles or structural slot wrappers from the commerce
   refactor; do not force sizing on the nested carousel slides themselves. */
#um-app #shop-header.shop-header .header-videos {
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  align-items: start !important;
  justify-items: stretch !important;
  gap: clamp(6px, 1.8vw, 24px) !important;
  width: min(100%, 950px) !important;
  max-width: 950px !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  flex: 0 0 auto !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

#um-app #shop-header.shop-header .header-videos > * {
  box-sizing: border-box;
  grid-column: auto !important;
  grid-row: auto !important;
  justify-self: stretch !important;
  align-self: start !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  flex: none !important;
}

/* Slot frames; leave the existing slide animation/visibility CSS untouched. */
#um-app #shop-header.shop-header .header-videos > .video,
#um-app #shop-header.shop-header .header-videos > * > .video {
  box-sizing: border-box;
  position: relative;
  display: flex;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 9 / 16 !important;
  overflow: hidden;
  border-radius: clamp(10px, 2vw, 25px);
}

#um-app #shop-header.shop-header .header-videos .video video,
#um-app #shop-header.shop-header .header-videos .video img {
  max-width: 100%;
  object-fit: contain !important;
  object-position: center !important;
}

@media (max-width: 720px) {
  #um-app #shop-header.shop-header {
    width: calc(100% - 16px) !important;
    margin-top: 9px !important;
    padding: clamp(10px, 3.2vw, 18px) clamp(6px, 2.4vw, 12px) !important;
    gap: clamp(8px, 2.2vw, 13px) !important;
    border-radius: clamp(16px, 4.5vw, 23px) !important;
  }
  #um-app #shop-header.shop-header .header-videos {
    gap: clamp(5px, 1.6vw, 11px) !important;
  }
  #um-app #shop-header.shop-header .header-videos > .video,
  #um-app #shop-header.shop-header .header-videos > * > .video {
    border-radius: clamp(7px, 2.5vw, 14px) !important;
  }
}
