/* Added at the bottom of styles.css */

/* Responsive Grid & Cart Layout */
.catalog-grid { 
  display: grid; 
  gap: 40px; 
}

/* Form Styles for Cart */
.tax-calculator {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--color-sage-light);
}
.form-input-small {
  width: 100%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--color-sage-light);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  color: var(--text-dark);
}
.form-input-small:focus {
  outline: none;
  border-color: var(--color-sage);
}

/* Hamburger Button & Drawer Navigation (Global) */
.hamburger-btn {
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 15px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 100001;
  transition: var(--breeze);
}
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #bf953f 100%);
  background-size: 200% auto;
  animation: goldShine 4s linear infinite;
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Hamburger Active Morphing state */
.hamburger-btn.active span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile Menu Backdrop Overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(43, 53, 47, 0.3);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  display: block !important;
}
.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Slide-out Menu Drawer */
.mobile-nav-menu {
  display: flex !important;
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background: rgba(251, 249, 246, 0.98) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 5px 0 30px rgba(122, 143, 129, 0.15);
  z-index: 100000;
  transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  flex-direction: column;
  padding: 25px 20px;
  box-sizing: border-box;
  border-right: 1px solid var(--color-cream);
  overflow-y: auto;
}
.mobile-nav-menu.active {
  left: 0;
}

/* Mobile Menu Header */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--color-cream);
}
.mobile-menu-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-sage-deep);
}
.mobile-menu-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.mobile-menu-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

/* Giving Goal Card at the Top of Menu */
.mobile-menu-goal-card {
  background: rgba(122, 143, 129, 0.06);
  border: 1px solid rgba(122, 143, 129, 0.12);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 25px;
}
.mobile-goal-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-sage-deep);
}
.mobile-goal-percent {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-gold-deep);
}
.mobile-progress-track {
  background: rgba(180, 196, 185, 0.25);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}
.mobile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-sage) 0%, var(--color-gold-deep) 100%);
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 0 10px rgba(170, 139, 40, 0.2);
}
.mobile-goal-desc {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-muted);
}

/* Mobile Menu Navigation Items */
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: auto; /* Push auth items to the bottom */
}
.mobile-nav-item {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dark);
  cursor: pointer;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: var(--breeze);
  display: flex;
  align-items: center;
}
.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--color-sage-deep);
  padding-left: 5px;
}

/* Mobile Actions & User Info at bottom of menu */
.mobile-menu-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-cream);
}
.mobile-user-info {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(180, 196, 185, 0.12);
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  word-break: break-all;
  line-height: 1.4;
}
.btn-mobile-action {
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: var(--breeze);
  text-align: center;
  border: 1px solid var(--color-sage);
  background: transparent;
  color: var(--color-sage-deep);
}
.btn-mobile-action:hover {
  background: rgba(122, 143, 129, 0.05);
}
.btn-mobile-primary {
  background: var(--color-sage-deep) !important;
  border-color: var(--color-sage-deep) !important;
  color: white !important;
}
.btn-mobile-primary:hover {
  background: #6a7f71 !important;
}

/* Mobile & Tablet Styles */
@media (max-width: 1023px) {
  .top-sticky-header {
    height: 60px !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 5% !important;
    gap: 0 !important;
  }
  .sandbox-indicator-bar {
    font-size: 0.62rem;
    margin-right: auto;
  }
  
  /* Collapse Top Navigation and Actions into Hamburger */
  .top-header-navigation,
  .top-header-actions {
    display: none !important;
  }
  
  body {
    padding-top: 60px !important; /* Slimmer header padding */
  }

  #hero-golden-logo {
    width: 40vw;
    top: 0;
  }

  #video-caption-box {
    width: 90vw !important;
    box-sizing: border-box !important;
  }

  .catalog-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; 
  }
  /* Project cards: single column on mobile */
  #selected-project-container > div:last-child {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .grid-main { 
    display: block; /* Stack catalog over nothing, since sidebar moves */
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto !important;
    z-index: 1000;
  }
  .cart-drawer-handle {
    display: block;
    width: 40px;
    height: 4px;
    background: var(--color-sage-light);
    border-radius: 2px;
    margin: 4px auto 8px auto;
    cursor: pointer;
  }
  .cart-mobile-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-sage-deep);
    margin-top: 5px;
    cursor: pointer;
  }
  .cart-panel {
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(122, 143, 129, 0.15);
    padding: 10px 20px 15px 20px !important;
    background: rgba(251, 249, 246, 0.98) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--color-cream);
    border-bottom: none;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.4s ease;
    max-height: 60px; /* Default collapsed height (shows only header and mobile summary) */
    overflow: hidden;
  }
  .cart-panel.expanded {
    max-height: 80vh; /* Slide up to 80% screen height when expanded */
    overflow-y: auto;
    padding-bottom: 30px !important;
  }
  /* Hide details on mobile when collapsed */
  .cart-panel:not(.expanded) .cart-items,
  .cart-panel:not(.expanded) .tax-calculator,
  .cart-panel:not(.expanded) .cart-totals,
  .cart-panel:not(.expanded) #cart-payout-disclosure,
  .cart-panel:not(.expanded) .btn-primary,
  .cart-panel:not(.expanded) .cart-title,
  .cart-panel:not(.expanded) .cart-subtitle {
    display: none !important;
  }
  .cart-panel:not(.expanded) .cart-mobile-summary {
    display: flex !important;
  }
  .cart-panel.expanded .cart-mobile-summary {
    display: none !important;
  }
  .cart-header {
    margin-bottom: 0 !important;
    cursor: pointer;
    text-align: center;
  }
  .cart-panel.expanded .cart-header {
    margin-bottom: 25px !important;
  }
  .mobile-cart-close {
    display: none;
  }
  .cart-panel.expanded .mobile-cart-close {
    display: block;
    position: absolute;
    top: -5px;
    right: 0;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--text-dark);
    cursor: pointer;
    z-index: 10;
  }
  
  main.container {
    padding-bottom: 85px !important; /* Standard padding for collapsed vessel summary bar */
  }
  /* Optional: Make the hero presentation not take up 100vh on mobile if it feels too large, but 100vh is fine */
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .top-header-navigation {
    display: none !important;
  }

  .hamburger-btn {
    display: flex !important;
  }

  .mobile-nav-menu {
    display: flex !important;
  }

  .mobile-nav-overlay {
    display: block !important;
  }

  .cart-drawer-handle,
  .cart-mobile-summary {
    display: none !important;
  }

  .catalog-grid { 
    grid-template-columns: repeat(4, 1fr); 
  }
  .grid-main { 
    display: grid; 
    grid-template-columns: 80% 1fr; /* main area vs sidebar */
    gap: 40px;
  }
  .sidebar {
    position: sticky;
    top: 40px;
    align-self: start;
    z-index: 50; /* ensure it stays above scrolling items */
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    /* Optional: hide scrollbar for elegance */
    scrollbar-width: thin;
    scrollbar-color: var(--color-sage-light) transparent;
  }
}

/* Multi-channel Social Auth & Wizard Loading Spinners */
.btn-social {
  transition: all 0.3s ease;
}
.btn-social:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
}
.btn-facebook:hover {
  background: #166fe5 !important;
  border-color: #166fe5 !important;
  color: #ffffff !important;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
