/* ==========================================================================
   Chłonę Design — Layout Styles (Header, Footer, Drawers, App Tab-Bar)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Site Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-height-mobile);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background-color: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 900px) {
  .site-header {
    height: var(--header-height-desktop);
    padding: 0 48px;
  }
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

/* Mobile Hamburger Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 15px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 1.8px;
  background-color: var(--ink);
  border-radius: 1px;
}

@media (min-width: 900px) {
  .hamburger-btn {
    display: none !important;
  }
}

/* Header Logo */
.site-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 899px) {
  .site-header__logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

.chlone-brand-logo {
  font-family: var(--font-script);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.01em;
}

@media (min-width: 900px) {
  .chlone-brand-logo {
    font-size: 34px;
  }
}

/* Center Desktop Navigation */
.site-header__nav {
  display: none;
}

@media (min-width: 900px) {
  .site-header__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

.site-header__nav-list {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header__nav-list a {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 8px 0;
  border-bottom: 1.5px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.site-header__nav-list a:hover,
.site-header__nav-list a.is-active,
.site-header__nav-list .current-menu-item > a {
  color: var(--ink);
  border-color: var(--ink);
}

/* Header Action Right (Search + Cart) */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  z-index: 2;
}

.header-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all .2s ease;
}

.header-search-toggle:hover {
  background-color: var(--line);
  color: var(--ink);
}

.header-cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header-cart-link .label {
  display: none;
}

@media (min-width: 900px) {
  .header-cart-link .label {
    display: inline-block;
  }
}

.header-cart-link .cart-count-badge {
  position: absolute;
  top: -4px;
  right: -8px;
}

@media (min-width: 900px) {
  .header-cart-link .cart-count-badge {
    position: static;
    margin-left: 2px;
  }
}

/* Slide-down Expandable Product Search Bar */
.site-header__search-modal {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 16px 24px;
  box-shadow: 0 10px 30px rgba(34, 29, 25, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
  z-index: 90;
}

.site-header__search-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-modal-container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
}

.search-modal-form {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 16px;
}

.search-modal-form .search-icon-wrap {
  color: var(--ink-muted);
  display: flex;
  align-items: center;
}

.search-modal-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
}

.search-modal-input::placeholder {
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.search-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color .2s ease;
}

.search-modal-close:hover {
  color: var(--ink);
}

/* Mobile Drawer Search Form */
.mobile-drawer__search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 24px;
}

.mobile-drawer__search-form .search-icon {
  color: var(--ink-muted);
  display: flex;
  align-items: center;
}

.mobile-drawer__search-form input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
}

/* --------------------------------------------------------------------------
   Mobile Off-Canvas Menu Drawer
   -------------------------------------------------------------------------- */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  transition: visibility .32s ease;
}

.mobile-drawer.is-open {
  visibility: visible;
}

.mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(34, 29, 25, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .32s ease;
}

.mobile-drawer.is-open .mobile-drawer__backdrop {
  opacity: 1;
}

.mobile-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(360px, 86vw);
  height: 100%;
  background-color: var(--bg);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
}

.mobile-drawer.is-open .mobile-drawer__panel {
  transform: translateX(0);
}

.mobile-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.mobile-drawer__body {
  padding: 32px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  margin-bottom: 30px;
}

.mobile-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.mobile-drawer__cart-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: var(--ink);
  border-radius: 4px;
  margin-bottom: auto;
  color: var(--bg);
  transition: background-color .2s ease;
}

.mobile-drawer__cart-card:hover {
  background-color: var(--ink-light);
  color: #ffffff;
}

.mobile-drawer__cart-card .cart-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: inherit;
}

.mobile-drawer__footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-drawer__footer .footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-drawer__footer .footer-links a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.mobile-drawer__footer .footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   App-Style Bottom Tab Bar (Mobile Only)
   -------------------------------------------------------------------------- */
.app-tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  height: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background-color: var(--bg);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

@media (min-width: 900px) {
  .app-tab-bar {
    display: none;
  }
}

.app-tab-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 6px 12px;
}

.app-tab-bar__item.is-active {
  color: var(--ink);
  font-weight: 600;
}

.app-tab-bar__icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-tab-bar__icon-wrap .cart-count-badge {
  position: absolute;
  top: -4px;
  right: -8px;
}

body.has-mobile-tabbar {
  padding-bottom: var(--tabbar-height);
}

@media (min-width: 900px) {
  body.has-mobile-tabbar {
    padding-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   Pre-Footer Products Carousel (Single Product)
   -------------------------------------------------------------------------- */
.prefooter-products-section {
  padding: 50px 0 40px;
  border-top: 1px solid var(--line);
  background-color: var(--bg);
}

@media (min-width: 900px) {
  .prefooter-products-section {
    padding: 80px 0 60px;
  }
}

.prefooter-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 20px 20px;
}

@media (min-width: 900px) {
  .prefooter-section-header {
    padding: 0 48px 24px;
  }
}

.prefooter-section-header h2 {
  font-size: 1.55rem;
  margin: 4px 0 0;
}

.prefooter-section-header .see-all-link {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.prefooter-section-header .see-all-link:hover {
  color: var(--ink);
}

.prefooter-products-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 0 20px 10px;
}

@media (min-width: 900px) {
  .prefooter-products-track {
    padding: 0 48px 10px;
    gap: 24px;
  }
}

.prefooter-products-track::-webkit-scrollbar {
  display: none;
}

/* On mobile: show approx 2.3 cards across viewport */
.prefooter-product-card {
  flex: 0 0 calc((100vw - 52px) / 2.3);
  min-width: 140px;
  scroll-snap-align: start;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease;
}

@media (min-width: 600px) {
  .prefooter-product-card {
    flex: 0 0 calc((100vw - 64px) / 3.3);
  }
}

@media (min-width: 900px) {
  .prefooter-product-card {
    flex: 0 0 250px;
    min-width: auto;
  }
}

.prefooter-product-card .card-thumb {
  width: 100%;
  aspect-ratio: 4/5;
  background-color: var(--bg-card);
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.prefooter-product-card .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  display: block;
}

.prefooter-product-card:hover .card-thumb img {
  transform: scale(1.03);
}

.prefooter-product-card .card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 3px;
  color: var(--ink);
  line-height: 1.25;
}

@media (min-width: 900px) {
  .prefooter-product-card .card-title {
    font-size: 1.2rem;
  }
}

.prefooter-product-card .card-price {
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--line);
}

.site-footer__main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 60px 24px 40px;
}

@media (min-width: 900px) {
  .site-footer__main {
    grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
    padding: 80px 48px 60px;
  }
}

.site-footer__brand p {
  font-size: 0.94rem;
  margin-top: 16px;
  margin-bottom: 24px;
  color: var(--ink-light);
  max-width: 320px;
}

.site-footer__social {
  display: flex;
  gap: 12px;
}

.site-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  transition: all .2s ease;
}

.site-footer__social a:hover {
  background-color: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.footer-column-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 20px;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-nav-list a {
  font-size: 0.92rem;
  color: var(--ink);
  transition: color .2s ease;
}

.footer-nav-list a:hover {
  color: var(--terracotta);
}

.contact-info-list p {
  font-size: 0.92rem;
  margin-bottom: 8px;
}

/* Newsletter in Footer */
.newsletter-block p {
  font-size: 0.92rem;
  margin-bottom: 20px;
  color: var(--ink-light);
}

.newsletter-form {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 8px;
}

.newsletter-form input {
  flex: 1;
  font-size: 0.92rem;
  color: var(--ink);
}

.newsletter-form input::placeholder {
  color: var(--ink-muted);
}

.newsletter-form .newsletter-btn {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  padding: 4px 0 4px 12px;
}

.newsletter-feedback {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  font-size: 0.8rem;
  transition: opacity .2s ease;
}

.newsletter-feedback.is-success {
  color: #2e6b38;
}

.newsletter-feedback.is-error {
  color: #b0382b;
}

/* Footer Bottom Bar */
.site-footer__bottom {
  border-top: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

@media (min-width: 900px) {
  .site-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    padding: 28px 48px;
    text-align: left;
  }
}

.site-footer__copyright {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.payment-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-chip {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  background-color: var(--bg);
}
