/**
 * Craftex Location Bar Widget Styles
 * Package: craftex-location-bar
 * Version: 1.3.0
 */

/* Section Base */
.craftex-location-bar-section {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background-color: #D8D7CC;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: var(--craftex-location-bar-padding, 3% 5% 2% 5%);
  opacity: 1; /* Progressive enhancement: visible by default */
}

/* Background Media & Overlay Layering */
.craftex-section-bg-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
}

.craftex-section-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Pattern Overlay: Slash Texture (// // //) */
.craftex-location-bar-section.pattern-slash {
  --craftex-slash-color: rgba(62, 63, 63, 0.12);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--craftex-slash-color),
    var(--craftex-slash-color) 1px,
    transparent 1px,
    transparent 14px
  );
}

/* Pattern Overlay: Plus Grid (+ + +) */
.craftex-location-bar-section.pattern-grid {
  --craftex-grid-color: rgba(62, 63, 63, 0.15);
  background-image: radial-gradient(var(--craftex-grid-color) 1px, transparent 0);
  background-size: 32px 32px;
  background-position: -19px -19px;
}

.craftex-location-bar-section.pattern-grid::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M23.5 20.5h1v3h3v1h-3v3h-1v-3h-3v-1h3v-3z' fill='%233E3F3F' fill-opacity='0.15'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-position: 0 0;
  z-index: 2;
}

/* Container Base */
.craftex-location-bar-container {
  position: relative;
  z-index: 3;
  margin-left: auto;
  margin-right: auto;
  width: min(100%, 1600px);
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
}

/* -------------------------------------------------------------
 * 1. Desktop 4-Column Grid Layout
 * ------------------------------------------------------------- */
.craftex-location-bar-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 48px;
  width: 100%;
}

.craftex-location-bar-content-group {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 48px;
  justify-content: flex-end;
  flex: 1 1 auto;
}

.craftex-location-col {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Brand Logo Column */
.craftex-location-brand {
  display: block;
}

.craftex-location-brand-link {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

.craftex-location-logo {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
  object-position: left center;
}

.craftex-location-brand-text {
  font-family: "OCRBLetterpressMW01-Regular", "OCR B Std", monospace;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  color: #3E3F3F;
  letter-spacing: 0.05em;
}

@media (max-width: 767px) {
  .craftex-location-brand {
    text-align: center;
  }
  .craftex-location-logo {
    margin-inline: auto;
    object-position: center center;
  }
  .craftex-location-brand--desktop,
  .craftex-location-brand-col--hide-mobile {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .craftex-location-brand--mobile {
    display: none !important;
  }
}

/* -------------------------------------------------------------
 * 2. Top Accent Line & Subheader
 * ------------------------------------------------------------- */
.craftex-col-header {
  border-bottom: 1px solid rgba(62, 63, 63, 0.35);
  padding-bottom: 8px;
  margin-bottom: 18px;
  width: 100%;
  display: block;
}

.craftex-col-title {
  font-family: "OCRBLetterpressMW01-Regular", "OCR B Std", "Courier New", monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #3E3F3F;
  display: block;
}

/* -------------------------------------------------------------
 * 3. Body Copy & Contact Links
 * ------------------------------------------------------------- */
.craftex-location-copy {
  font-family: "Aeoniktrial", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
  color: #3E3F3F;
}

.craftex-contact-item {
  margin: 0 0 6px 0;
}

.craftex-contact-item:last-child {
  margin-bottom: 0;
}

.craftex-contact-link {
  color: #3E3F3F;
  text-decoration: none;
  transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.craftex-contact-link:hover,
.craftex-contact-link:focus-visible,
.craftex-contact-link:active {
  color: #FFFFFF;
}

.craftex-contact-link:focus-visible,
.craftex-social-btn:focus-visible {
  outline: 2px solid #1D82EA;
  outline-offset: 3px;
}

.craftex-contact-extra {
  margin-top: 8px;
}

/* -------------------------------------------------------------
 * 4. Circular Outlined Social Buttons
 * ------------------------------------------------------------- */
.craftex-location-social-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.craftex-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #3E3F3F;
  border-radius: 50%;
  color: #3E3F3F;
  font-size: 14px;
  text-decoration: none;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.craftex-social-btn:hover,
.craftex-social-btn:focus-visible,
.craftex-social-btn:active {
  background-color: #8D7E63;
  border-color: #8D7E63;
  color: #FFFFFF;
}

.craftex-social-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.craftex-social-custom-img {
  max-width: 14px;
  max-height: 14px;
  object-fit: contain;
  display: block;
}

/* -------------------------------------------------------------
 * 5. Stagger Reveal & Entrance Motion Presets
 * ------------------------------------------------------------- */
.craftex-reveal-item {
  opacity: 1; /* Visible by default */
}

/* Hidden state prior to scroll reveal (Default Fade Up) */
.craftex-location-bar-section.is-craftex-motion-ready[data-craftex-reveal="yes"]:not(.is-craftex-visible) .craftex-reveal-item {
  opacity: 0;
  transform: translateY(28px);
}

/* Entrance Preset: Fade Up */
.craftex-location-bar-section[data-motion-preset="fade-up"].is-craftex-motion-ready:not(.is-craftex-visible) .craftex-reveal-item {
  opacity: 0;
  transform: translateY(28px);
}

/* Entrance Preset: Pure Fade In */
.craftex-location-bar-section[data-motion-preset="fade-in"].is-craftex-motion-ready:not(.is-craftex-visible) .craftex-reveal-item {
  opacity: 0;
  transform: translateY(0);
}

/* Entrance Preset: Fade & Zoom */
.craftex-location-bar-section[data-motion-preset="fade-zoom"].is-craftex-motion-ready:not(.is-craftex-visible) .craftex-reveal-item {
  opacity: 0;
  transform: scale(0.96) translateY(12px);
}

/* Revealed Active State */
.craftex-location-bar-section.is-craftex-motion-ready[data-craftex-reveal="yes"].is-craftex-visible .craftex-reveal-item {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity var(--craftex-motion-duration, 0.9s) cubic-bezier(0.16, 1, 0.3, 1),
              transform var(--craftex-motion-duration, 0.9s) cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--craftex-reveal-order, 0) * var(--craftex-stagger-delay, 0.12s));
}

/* Elementor Editor Active Fallback: Always 100% visible */
.elementor-editor-active .craftex-location-bar-section,
.elementor-editor-active .craftex-location-bar-section *,
body.elementor-editor-active .craftex-reveal-item {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* -------------------------------------------------------------
 * 6. Responsive Media Queries (Mobile & Tablet Breakpoints)
 * ------------------------------------------------------------- */
@media (max-width: 1024px) {
  .craftex-location-bar-section {
    min-height: 0;
    padding: 56px 40px 28px;
  }

  .craftex-location-bar-grid {
    gap: 36px;
  }

  .craftex-location-bar-content-group {
    gap: 36px;
  }
}

@media (max-width: 767px) {
  .craftex-location-bar-section {
    min-height: 0;
    padding: 48px 20px 24px;
  }

  .craftex-location-bar-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 36px;
  }

  .craftex-location-bar-content-group {
    flex-direction: column;
    width: 100%;
    gap: 36px;
  }

  .craftex-location-col {
    text-align: right; /* Default right-aligned content flow on mobile matching screenshot */
  }

  .craftex-col-header {
    text-align: right;
  }

  .craftex-location-social-row {
    justify-content: flex-end; /* Right-aligned circular buttons on mobile */
  }

  .craftex-location-bar-legal {
    font-size: 0.8125rem;
    text-align: right;
    padding-top: 24px;
    margin-top: 24px;
  }
}

.craftex-location-bar-legal {
  font-family: "Aeoniktrial", "Aeonik TRIAL", Arial, sans-serif;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.5;
  margin-top: 0;
  padding-top: 32px;
  border-top: 1px solid var(--craftex-rule-color, rgba(255, 255, 255, 0.25));
  opacity: 0.9;
  text-align: center;
  width: 100%;
}

/* Scroll Snap Bottom Align (Native CSS Engine) */
.craftex-location-bar-section[data-craftex-snap-bottom="yes"] {
  scroll-snap-align: end !important;
  scroll-snap-stop: always !important;
}

/* -------------------------------------------------------------
 * Desktop Height (Default 30vh) & Image Pairing
 * ------------------------------------------------------------- */
@media (min-width: 1025px) {
  .elementor-widget-craftex-location-bar {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  /* Remove container margin on desktop view and allow full width */
  .craftex-location-bar-container {
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
  }

  .craftex-location-bar-grid {
    width: 100%;
    justify-content: space-between;
  }

  /* Align content group to the end on desktop view */
  .craftex-location-bar-content-group {
    margin-left: auto !important;
    justify-content: flex-end !important;
  }

  /* Default desktop height is 30vh (customizable via Elementor Section Height slider) */
  .craftex-location-bar-section {
    height: var(--craftex-location-bar-height, 30vh);
    max-height: var(--craftex-location-bar-height, 30vh);
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    padding: var(--craftex-location-bar-padding, 3% 5% 2% 5%);
  }

  .craftex-location-bar-legal {
    padding-top: clamp(10px, 1.4vh, 24px);
    margin-top: 0;
  }

  /* Automatically collapse container gaps when paired */
  :is(.e-con, .elementor-container):has(> .elementor-widget-craftex-image):has(> .elementor-widget-craftex-location-bar) {
    gap: 0 !important;
    --widgets-spacing: 0px !important;
    --widgets-spacing-row: 0px !important;
    --widgets-spacing-column: 0px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  :is(.e-con, .elementor-container):has(> .elementor-widget-craftex-image):has(> .elementor-widget-craftex-location-bar) > .elementor-widget-craftex-location-bar {
    height: var(--craftex-location-bar-height, 30vh) !important;
    height: var(--craftex-location-bar-height, 30dvh) !important;
    max-height: var(--craftex-location-bar-height, 30vh) !important;
    max-height: var(--craftex-location-bar-height, 30dvh) !important;
    flex: 0 0 var(--craftex-location-bar-height, 30vh) !important;
    flex: 0 0 var(--craftex-location-bar-height, 30dvh) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    overflow: hidden !important;
  }

  :is(.e-con, .elementor-container):has(> .elementor-widget-craftex-image):has(> .elementor-widget-craftex-location-bar) > .elementor-widget-craftex-location-bar .craftex-location-bar-section {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: var(--craftex-location-bar-padding, 3% 5% 2% 5%) !important;
  }

  :is(.e-con, .elementor-container):has(> .elementor-widget-craftex-image):has(> .elementor-widget-craftex-location-bar) > .elementor-widget-craftex-location-bar .craftex-location-bar-legal {
    padding-top: clamp(10px, 1.4vh, 24px);
    margin-top: 0;
  }

  /* Explicit screen-fit container opt-in */
  :is(.e-con, .elementor-container).craftex-screen-fit-container {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    gap: 0 !important;
    --widgets-spacing: 0px !important;
    --widgets-spacing-row: 0px !important;
    --widgets-spacing-column: 0px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
}


