/* ============================================
   ORGANIC URBAN — CLEAN MOBILE SYSTEM
   Targeted fixes without !important conflicts
   Version: 2.0 - Clean, systematic mobile-first design
   ============================================ */

/* ============================================
   MOBILE FOUNDATION (320px - 767px)
   ============================================ */
@media screen and (max-width: 768px) {

  /* Reset and foundation */
  html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }

  body {
    font-size: 1rem;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 3.75rem !important;
  }

  /* Ensure main content doesn't go under fixed header */
  main,
  .main-content,
  .content,
  .page-content,
  .hero-section,
  section:first-of-type {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Container constraints */
  .container,
  .section-inner,
  .content-wrapper {
    width: 100%;
    max-width: 100vw;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
  }

  /* ============================================
     LAYOUT SYSTEMS
     ============================================ */

  /* Grid systems */
  .grid,
  .row,
  [class*="grid"]:not(.bestsellers-grid),
  [class*="row"] {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .col,
  .column,
  [class*="col-"],
  [class*="column-"] {
    flex: 1 1 100%;
    width: 100%;
    margin-bottom: 1rem;
  }

  /* Flex utilities */
  .flex,
  .flex-row,
  [class*="flex"] {
    flex-direction: column !important;
    align-items: stretch;
  }

  .flex>*,
  [class*="flex"]>* {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* ============================================
     HEADER & NAVIGATION
     ============================================ */

  /* OVERRIDE header-consistency.css - Force fixed header on mobile */
  .site-header,
  body .site-header,
  html .site-header,
  * .site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    width: 100% !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(0.625rem) !important;
    -webkit-backdrop-filter: blur(0.625rem) !important;
    border-bottom: 0.0625rem solid rgba(229, 224, 216, 0.8) !important;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.05) !important;
    padding: 0.5rem 0 !important;
    min-height: 3.75rem !important;
    max-height: 3.75rem !important;
    height: 3.75rem !important;
    display: flex !important;
    align-items: center !important;
    overflow: visible !important;
  }

  /* Mobile menu overlay removed - #mobile-nav-overlay in mobile-nav.php handles this */

  /* OVERRIDE header-consistency.css - Force proper grid layout */
  .header-inner,
  body .site-header .header-inner,
  html .site-header .header-inner,
  * .site-header .header-inner {
    display: grid !important;
    grid-template-columns: 50px 1fr auto !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.5rem 1rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    gap: 0.5rem !important;
    margin: 0 auto !important;
    position: relative !important;
    overflow: visible !important;
  }

  /* Hamburger button - ICON ONLY, no box, no border, no background */
  /* Premium design: subtle, minimal, same visual weight as other icons */
  #menuToggle,
  button#menuToggle,
  body .site-header #menuToggle,
  html .site-header #menuToggle,
  * .site-header #menuToggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    padding: 8px !important;
    margin: 0 !important;
    transition: opacity 0.2s ease !important;
    z-index: 10001 !important;
    position: relative !important;
    grid-column: 1 !important;
    order: 1 !important;
    justify-self: start !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
    font-size: 1.5rem !important;
    color: #2f2a24 !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    font-family: inherit !important;
  }

  #menuToggle:hover,
  #menuToggle:focus {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    opacity: 0.6 !important;
  }

  #menuToggle:active {
    background: none !important;
    background-color: transparent !important;
    transform: none !important;
    border: none !important;
    box-shadow: none !important;
    opacity: 0.5 !important;
  }

  /* Logo - stays in header - OVERRIDE header-consistency.css */
  .logo,
  body .site-header .header-inner>.logo,
  html .site-header .header-inner>.logo,
  * .site-header .header-inner>.logo {
    grid-column: 2 !important;
    order: 2 !important;
    justify-self: center !important;
    text-align: center !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #2f2a24 !important;
    text-decoration: none !important;
    margin: 0 auto !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 200px !important;
    position: relative !important;
    z-index: 10002 !important;
    /* High z-index to prevent overlap */
    isolation: isolate !important;
  }

  .logo img,
  .logo picture {
    max-height: 32px !important;
    width: auto !important;
    display: block !important;
    position: relative !important;
    z-index: 10003 !important;
  }

  /* ============================================
     SYSTEM A MOBILE NAV REMOVED
     ============================================
     The .nav.mobile-active system has been removed.
     Mobile navigation is now handled exclusively by:
     - #mobile-nav-overlay (markup in mobile-nav.php)
     - layout.js (JavaScript control)
     
     DO NOT add .nav mobile styles here.
     ============================================ */

  /* Desktop nav is hidden on mobile - mobile uses #mobile-nav-overlay instead */
  .nav {
    display: none !important;
  }

  /* Header actions on mobile - stays in header */
  .header-actions,
  body .site-header .header-inner>.header-actions,
  html .site-header .header-inner>.header-actions {
    grid-column: 3 !important;
    order: 3 !important;
    justify-self: end !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 10002 !important;
    /* Match header logo z-index */
    width: auto !important;
  }

  .header-actions button,
  .header-actions a {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .search-icon-btn,
  .cart-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #2f2a24;
  }

  .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #7a9a7a;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
  }

  /* ============================================
     TYPOGRAPHY
     ============================================ */

  h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  h2 {
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 0.875rem;
  }

  h3 {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
  }

  h4 {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 0.625rem;
  }

  h5 {
    font-size: 1.125rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
  }

  h6 {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
  }

  p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  /* ============================================
     FORMS
     ============================================ */

  input,
  textarea,
  select {
    width: 100%;
    font-size: 16px;
    /* Prevents zoom on iOS */
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
  }

  input:focus,
  textarea:focus,
  select:focus {
    outline: none;
    border-color: #7a9a7a;
    box-shadow: 0 0 0 3px rgba(122, 154, 122, 0.1);
  }

  .form-group {
    margin-bottom: 1rem;
  }

  label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2f2a24;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.375rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 2.75rem;
    width: 100%;
  }

  .btn-primary {
    background: #7a9a7a;
    color: white;
  }

  .btn-primary:hover {
    background: #6b8b6a;
  }

  .btn-secondary {
    background: white;
    color: #2f2a24;
    border: 1px solid #d1d5db;
  }

  .btn-secondary:hover {
    background: #f7f5f2;
  }

  /* ============================================
     IMAGES & MEDIA
     ============================================ */

  img,
  picture,
  video {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* Hero sections */
  .hero,
  .hero-section {
    padding: 2rem 0;
    text-align: center;
  }

  .hero-image,
  .hero-bg {
    width: 100%;
    height: 40vh;
    min-height: 250px;
    max-height: 400px;
    object-fit: cover;
    border-radius: 0.5rem;
  }

  /* Product cards */
  .product-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
  }

  .product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
  }

  /* ============================================
     COMPONENTS
     ============================================ */

  .card,
  .content-block {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  section {
    padding: 2rem 0;
  }

  /* Hide desktop elements */
  .desktop-only,
  .hidden-md-up {
    display: none !important;
  }

  /* Show mobile elements */
  .mobile-only,
  .hidden-lg-down {
    display: block !important;
  }

  /* ============================================
     FLOATING ELEMENTS
     ============================================ */

  .whatsapp-float,
  .floating-btn {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25d366;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
  }

  /* Safe area for notched devices */
  @supports (padding-bottom: env(safe-area-inset-bottom)) {

    .whatsapp-float,
    .floating-btn {
      bottom: calc(1rem + env(safe-area-inset-bottom));
    }
  }
}

/* ============================================
   HERO SECTION - Match Reference Layout (py-20)
   ============================================ */
.hero {
  padding: 5rem 1rem !important;
  /* py-20 = 5rem */
  background: var(--bg-soft) !important;
  min-height: auto !important;
  margin-top: 0 !important;
  position: relative !important;
  overflow: hidden !important;
}

.hero-inner {
  max-width: 42rem !important;
  /* max-w-2xl */
  margin: 0 auto !important;
  padding: 0 !important;
  position: relative !important;
  z-index: 10 !important;
}

.hero-content {
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.hero h1 {
  font-size: 2.25rem !important;
  /* text-4xl */
  line-height: 1.1 !important;
  /* leading-tight */
  margin-bottom: 1.5rem !important;
  /* mb-6 */
  color: var(--text-dark) !important;
  font-weight: 400 !important;
}

.hero h1 br+span {
  font-style: italic !important;
}

.hero-subtitle {
  font-size: 1.125rem !important;
  /* text-lg */
  line-height: 1.75 !important;
  /* leading-relaxed */
  margin-bottom: 2.5rem !important;
  /* mb-10 */
  color: var(--text-muted) !important;
  max-width: 32rem !important;
  /* max-w-lg */
  margin-left: auto !important;
  margin-right: auto !important;
}

.hero-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  /* gap-4 */
  justify-content: center !important;
  width: 100% !important;
}

.cta-primary,
.cta-secondary {
  padding: 1rem 2rem !important;
  /* py-4 px-8 */
  font-size: 0.75rem !important;
  /* text-xs */
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  /* tracking-widest */
  font-weight: 700 !important;
  text-align: center !important;
  border-radius: 0.25rem !important;
  /* DEFAULT: 4px */
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

.cta-primary {
  background: var(--accent-sage) !important;
  color: var(--white) !important;
}

.cta-primary:hover {
  opacity: 0.9 !important;
}

.cta-secondary {
  background: transparent !important;
  color: var(--text-dark) !important;
  border: 0.0625rem solid #d1d5db !important;
  /* border-gray-300 */
}

.cta-secondary:hover {
  background: #f9fafb !important;
  /* hover:bg-gray-50 */
}

.hero-scroll-cue {
  display: none !important;
  /* Hide on mobile to match reference */
}

/* Trust strip: grid layout controlled in style.css (unified). No overrides here. */

/* Category section: bottom 32px for rhythm. */
.shop-by-category {
  padding: 0 0.5rem 32px 0.5rem !important;
  padding-top: 0 !important;
  background: #FAF9F6 !important;
}

.shop-by-category .section-inner {
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 24px 10px !important;
}

.shop-by-category .homepage-categories-wrapper {
  padding-left: 6px !important;
  padding-right: 6px !important;
}

.shop-by-category .section-header {
  text-align: center !important;
  margin-bottom: 0.5rem !important;
}

.category-label {
  font-size: 0.625rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3em !important;
  color: var(--accent-sage) !important;
  font-weight: 600 !important;
  margin-bottom: 8px !important;
  display: block !important;
}

.shop-by-category .section-header h2 {
  font-size: 1.5rem !important;
  font-family: var(--font-serif) !important;
  font-weight: 700 !important;
  color: var(--text-dark) !important;
  margin-bottom: 0 !important;
  line-height: 1.2 !important;
}

.section-intro {
  font-size: 0.875rem !important;
  color: #6b7280 !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  line-height: 1.5 !important;
}

/* Explore Our Rituals: defers to style.css (single source of truth) */
/* Only enforce border removal — grid layout controlled by style.css */
.shop-by-category .homepage-category-card,
.shop-by-category .homepage-category-card--hero {
  border: none !important;
}

.shop-by-category .homepage-category-image {
  border: none !important;
}

/* REMOVED: Old .category-cards-grid / .category-card overrides.
     Homepage now uses .homepage-categories-grid / .homepage-category-card
     with unified responsive styles in style.css (single source of truth). */

/* ============================================
     WORLD OF CLAYS - Match Reference (py-24, grid-cols-4, bg-clay-dark)
   ============================================ */
.world-of-clays-premium {
  background-color: #1F211E !important;
  /* bg-clay-dark */
  color: #ffffff !important;
  padding: 6rem 1rem !important;
  /* py-24 = 6rem */
  overflow: hidden !important;
}

.world-of-clays-inner {
  max-width: 64rem !important;
  /* max-w-4xl */
  margin: 0 auto !important;
  text-align: center !important;
}

.world-of-clays-header {
  text-align: center !important;
  margin-bottom: 0 !important;
}

.world-of-clays-label {
  font-size: 0.625rem !important;
  /* text-[10px] */
  text-transform: uppercase !important;
  letter-spacing: 0.4em !important;
  /* tracking-[0.4em] */
  color: var(--accent-sage) !important;
  /* text-primary */
  font-weight: 700 !important;
  margin-bottom: 1rem !important;
  /* mb-4 */
  display: block !important;
}

.world-of-clays-title {
  font-size: 2.25rem !important;
  /* text-4xl */
  font-family: var(--font-serif) !important;
  /* font-display */
  color: #ffffff !important;
  margin-bottom: 1.5rem !important;
  /* mb-6 */
  line-height: 1.2 !important;
}

.world-of-clays-subtitle {
  font-size: 0.875rem !important;
  color: #9ca3af !important;
  /* text-gray-400 */
  max-width: 42rem !important;
  /* max-w-2xl */
  margin: 0 auto 4rem auto !important;
  /* mb-16 */
  line-height: 1.75 !important;
  /* leading-relaxed */
}

.world-of-clays-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  /* grid-cols-4 */
  gap: 1.5rem !important;
  /* gap-6 */
  justify-items: center !important;
  margin-bottom: 4rem !important;
  /* mb-16 */
}

.clay-swatch-circle,
.clay-swatch-item {
  width: 3rem !important;
  /* w-12 */
  height: 3rem !important;
  /* h-12 */
  border-radius: 9999px !important;
  /* rounded-full */
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.clay-swatch-circle:hover {
  outline: 0.125rem solid rgba(255, 255, 255, 0.2) !important;
  /* hover:ring-2 ring-white/20 */
  outline-offset: 0.25rem !important;
  /* ring-offset-4 */
}

.world-of-clays-stats {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  /* grid-cols-2 */
  gap: 2rem !important;
  /* gap-8 */
  margin-bottom: 4rem !important;
  /* mb-16 */
  opacity: 0.8 !important;
}

.world-of-clays-stat-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
  /* gap-1 */
  text-align: left !important;
}

.stat-number {
  font-size: 1.125rem !important;
  /* text-lg */
  font-weight: 700 !important;
  color: #ffffff !important;
}

.stat-label {
  font-size: 0.625rem !important;
  /* text-[10px] */
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  /* tracking-widest */
  color: #6b7280 !important;
  /* text-gray-500 */
}

/* ============================================
     UBTANS SECTION - 2 cards per row (like Explore Our Rituals)
   ============================================ */
.ubtans-ritual {
  padding: 4rem 1rem 4.5rem !important;
  background: var(--bg-cream, #FAF8F4) !important;
}

.ubtans-ritual-inner {
  max-width: none !important;
  padding: 0 1rem !important;
  margin: 0 auto !important;
}

.ubtans-ritual-header {
  text-align: center !important;
  margin-bottom: 2.5rem !important;
}

.ubtans-ritual-label {
  font-size: 0.7rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.25em !important;
  color: var(--accent-sage) !important;
  font-weight: 600 !important;
  margin-bottom: 0.75rem !important;
  display: block !important;
}

.ubtans-ritual-title {
  font-size: 2rem !important;
  font-family: var(--font-serif) !important;
  color: var(--text-dark) !important;
  margin-bottom: 0.75rem !important;
  line-height: 1.2 !important;
}

.ubtans-ritual-subtitle {
  font-size: 0.95rem !important;
  color: var(--text-muted) !important;
  max-width: 24rem !important;
  margin: 0 auto !important;
  line-height: 1.6 !important;
}

.ubtans-ritual-grid {
  display: flex !important;
  flex-direction: row !important;
  /* Override generic column rule */
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scroll-snap-type: x mandatory !important;
  gap: 16px !important;
  padding-bottom: 24px !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;

  /* Reset layout margins */
  max-width: none !important;
  margin: 0 -1rem 2.5rem -1rem !important;
  /* Edge-to-edge feeling */
  padding: 0 1rem !important;
  /* Inner padding for snap alignment */
  background: transparent !important;
  grid-template-columns: none !important;
}

.ubtans-ritual-grid::-webkit-scrollbar {
  display: none !important;
}

.ubtan-ritual-card {
  flex: 0 0 82% !important;
  min-width: 82% !important;
  scroll-snap-align: center !important;

  background: var(--white) !important;
  border: 1px solid rgba(107, 100, 94, 0.08) !important;
  border-radius: 20px !important;
  overflow: hidden !important;

  transition: box-shadow 0.25s ease, transform 0.2s ease !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.ubtan-ritual-card:hover,
.ubtan-ritual-card:focus {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(-2px) !important;
}

.ubtan-color-block {
  height: 10rem !important;
  width: 100% !important;
}

.ubtan-card-content {
  padding: 1.75rem 1.5rem 2rem !important;
}

.ubtan-name {
  font-size: 1.4rem !important;
  font-family: var(--font-serif) !important;
  margin-bottom: 0.5rem !important;
  color: var(--text-dark) !important;
  line-height: 1.3 !important;
}

.ubtan-ritual-cue {
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--accent-sage) !important;
  font-weight: 600 !important;
  margin-bottom: 0.75rem !important;
}

.ubtan-description {
  font-size: 0.95rem !important;
  line-height: 1.65 !important;
  color: var(--text-muted) !important;
  margin-bottom: 1.25rem !important;
}

.ubtan-cta,
.ubtan-cta-default {
  font-size: 0.85rem !important;
  letter-spacing: 0.02em !important;
  font-weight: 600 !important;
  color: var(--accent-sage) !important;
  border-bottom: 2px solid var(--accent-sage) !important;
  padding-bottom: 0.25rem !important;
  text-decoration: none !important;
  display: inline-block !important;
}

.ubtan-whisper-line {
  font-size: 0.8rem !important;
  font-style: italic !important;
  color: var(--text-muted) !important;
  margin-top: 0.75rem !important;
  opacity: 0.9 !important;
}

.ubtans-ritual-footer {
  margin-top: 2rem !important;
  text-align: center !important;
}

.ubtans-ritual-footer-text {
  font-size: 0.8rem !important;
  letter-spacing: 0.05em !important;
  font-style: italic !important;
  opacity: 0.75 !important;
}

/* ============================================
   TABLET ADJUSTMENTS (768px - 1023px)
   ============================================ */
@media screen and (min-width: 768px) and (max-width: 1023px) {

  .container,
  .section-inner,
  .content-wrapper {
    max-width: 720px;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  /* Two-column grids on tablet */
  .tablet-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .tablet-grid-2>* {
    margin-bottom: 0;
  }
}