/*
 * Sweet BakeArt — final refinement layer
 * Loaded last on every complete page.
 * Fixes shared header geometry, natural word wrapping, mobile whitespace,
 * signature-gallery interaction colours, and subtle professional motion.
 */

:root {
  --final-refinement-version: 3;
  --final-header-height: 120px;
  --final-logo-size: 120px;
  --final-page-gutter: clamp(18px, 4vw, 40px);
  --final-radius: 22px;
  --final-maroon: #852d38;
  --final-text: #91444b;
  --final-pink: #f5c5d9;
  --final-peach: #e8beba;
  --final-yellow: #fae6be;
  --final-blue: #c5dbe9;
  --final-shadow: 0 18px 50px rgba(72, 34, 48, 0.12);
  --final-shadow-hover: 0 24px 58px rgba(72, 34, 48, 0.17);
  --final-ease: cubic-bezier(.2, .75, .2, 1);
}

/* --------------------------------------------------------------------------
   Natural text wrapping — never split an ordinary word one letter at a time.
   -------------------------------------------------------------------------- */
body,
p,
h1, h2, h3, h4, h5, h6,
a,
span,
li,
label,
button,
input,
textarea,
select {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: none !important;
}

h1, h2, h3, h4, h5, h6,
.hero-title,
.section-title,
.page-title {
  text-wrap: balance;
}

p,
li,
.hero-subtitle,
.section-subtitle,
.page-subtitle {
  text-wrap: pretty;
  widows: 2;
  orphans: 2;
}

/* Keep ordinary links intact; only genuinely long technical strings may split. */
.footer a,
.contact-info a,
.info-row a {
  overflow-wrap: break-word !important;
}

a[href^="mailto:"] {
  overflow-wrap: break-word !important;
}

.order-reference,
.product-code {
  overflow-wrap: anywhere !important;
}

html {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
[role="button"],
.gallery-item {
  -webkit-tap-highlight-color: rgba(133, 45, 56, 0.08);
}

/* --------------------------------------------------------------------------
   One shared header geometry on every public page.
   -------------------------------------------------------------------------- */
body:not(.page-admin):not(.page-admin-add):not(.page-admin-orders):not(.page-login):not(.page-register):not(.page-forgot)
header.navbar,
body:not(.page-admin):not(.page-admin-add):not(.page-admin-orders):not(.page-login):not(.page-register):not(.page-forgot)
header.navbar.scrolled,
body:not(.page-admin):not(.page-admin-add):not(.page-admin-orders):not(.page-login):not(.page-register):not(.page-forgot)
header.navbar.polish-scrolled {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: var(--final-header-height) !important;
  min-height: var(--final-header-height) !important;
  border: 0 !important;
  overflow: visible !important;
  z-index: 2000 !important;
}

header.navbar .nav-container,
header.navbar.scrolled .nav-container,
header.navbar.polish-scrolled .nav-container {
  width: min(1200px, calc(100% - 40px)) !important;
  max-width: 1200px !important;
  height: var(--final-header-height) !important;
  min-height: var(--final-header-height) !important;
  margin-inline: auto !important;
  padding: 0 !important;
  align-items: center !important;
}

header.navbar .logo,
header.navbar.scrolled .logo,
header.navbar.polish-scrolled .logo {
  width: var(--final-logo-size) !important;
  height: var(--final-logo-size) !important;
  min-width: var(--final-logo-size) !important;
  min-height: var(--final-logo-size) !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center !important;
  justify-content: center !important;
}

header.navbar .logo img,
header.navbar.scrolled .logo img,
header.navbar.polish-scrolled .logo img {
  width: var(--final-logo-size) !important;
  height: var(--final-logo-size) !important;
  max-width: var(--final-logo-size) !important;
  max-height: var(--final-logo-size) !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  transform: none !important;
  transition: filter .3s ease, opacity .3s ease !important;
}

header.navbar .nav-right,
header.navbar.scrolled .nav-right,
header.navbar.polish-scrolled .nav-right {
  align-items: center !important;
}

header.navbar .cart-icon,
header.navbar .menu-toggle {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  flex: 0 0 44px !important;
}

/* Scrolling changes only the surface, never the header's position or dimensions. */
header.navbar.polish-scrolled {
  position: fixed !important;
  background: rgba(255, 250, 251, .92) !important;
  border-bottom: 1px solid rgba(133, 45, 56, .08) !important;
  box-shadow: 0 14px 38px rgba(72, 34, 48, .11) !important;
  backdrop-filter: blur(18px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.08) !important;
}

/* Utility pages do not have a hero image, so give their header a clean surface. */
body.page-cart header.navbar:not(.polish-scrolled),
body.page-product header.navbar:not(.polish-scrolled) {
  position: absolute !important;
  background: linear-gradient(180deg, rgba(255, 250, 251, .98), rgba(255, 250, 251, .82)) !important;
  border-bottom: 1px solid rgba(133, 45, 56, .07) !important;
  box-shadow: 0 10px 32px rgba(72, 34, 48, .07) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

/* Page-level selectors beat legacy inline header rules that differ per file. */
body.page-index header.navbar .nav-container,
body.page-about header.navbar .nav-container,
body.page-gallery header.navbar .nav-container,
body.page-shop header.navbar .nav-container,
body.page-contact header.navbar .nav-container,
body.page-cart header.navbar .nav-container,
body.page-product header.navbar .nav-container {
  width: min(1200px, calc(100% - 40px)) !important;
  max-width: 1200px !important;
  height: var(--final-header-height) !important;
  min-height: var(--final-header-height) !important;
  margin-inline: auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Authentication layouts must never create an 8px horizontal spill. */
body.page-login,
body.page-register,
body.page-forgot {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow-x: hidden !important;
}

body.page-login .auth-wrapper,
body.page-register .auth-wrapper,
body.page-forgot .auth-wrapper,
body.page-login .auth-card,
body.page-register .auth-card,
body.page-forgot .auth-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.page-login .auth-container,
body.page-register .auth-container,
body.page-forgot .auth-container,
body.page-login form,
body.page-register form,
body.page-forgot form {
  max-width: calc(100vw - 28px) !important;
  box-sizing: border-box !important;
}

/* --------------------------------------------------------------------------
   Hero spacing and visual hierarchy.
   -------------------------------------------------------------------------- */
.hero-overlay {
  box-sizing: border-box !important;
  padding-top: var(--final-header-height) !important;
  padding-left: var(--final-page-gutter) !important;
  padding-right: var(--final-page-gutter) !important;
}

.hero-content {
  margin: 0 auto !important;
  isolation: isolate;
  animation: finalHeroContentIn .72s var(--final-ease) both;
}

@keyframes finalHeroContentIn {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

body.page-about .hero,
body.page-gallery .hero,
body.page-shop .hero,
body.page-contact .hero {
  height: clamp(560px, 68vh, 650px) !important;
  min-height: 560px !important;
}

body.page-about .hero-content,
body.page-gallery .hero-content,
body.page-shop .hero-content,
body.page-contact .hero-content {
  max-width: 760px !important;
}

/* Keep logo and hero glass panel visually separated at every width. */
body.page-about .hero-overlay,
body.page-gallery .hero-overlay,
body.page-shop .hero-overlay,
body.page-contact .hero-overlay {
  padding-bottom: clamp(30px, 5vw, 56px) !important;
}

/* --------------------------------------------------------------------------
   Signature gallery: brand styling instead of the unrelated gold shimmer.
   -------------------------------------------------------------------------- */
.gallery-item.signature {
  position: relative !important;
  border: 1px solid rgba(133, 45, 56, .18) !important;
  background: #fff !important;
  box-shadow: 0 18px 48px rgba(72, 34, 48, .13) !important;
}

.gallery-item.signature::after {
  display: inline-flex !important;
  align-items: center !important;
  content: "Featured Creation" !important;
  top: 14px !important;
  right: auto !important;
  bottom: auto !important;
  left: 14px !important;
  padding: .43rem .78rem !important;
  border: 1px solid rgba(255, 255, 255, .76) !important;
  border-radius: 999px !important;
  background: rgba(255, 250, 251, .88) !important;
  color: var(--final-maroon) !important;
  box-shadow: 0 10px 24px rgba(72, 34, 48, .12) !important;
  font-family: 'Open Sans', sans-serif !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
  letter-spacing: .045em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.gallery-item.signature:hover,
.gallery-item.signature:focus,
.gallery-item.signature:focus-within,
.gallery-item.signature:active {
  border-color: rgba(133, 45, 56, .27) !important;
  background: #fff !important;
  box-shadow: var(--final-shadow-hover) !important;
}

.gallery-item.signature:hover::after,
.gallery-item.signature:focus::after,
.gallery-item.signature:active::after {
  background: rgba(255, 250, 251, .94) !important;
  color: var(--final-maroon) !important;
  animation: none !important;
}

.gallery-item:active,
.gallery-preview-grid a:active,
.product-card:active,
.feature-card:active {
  filter: none !important;
}

/* Generic gallery hover remains subtle and brand-consistent. */
.gallery-item:not(.signature)::after {
  background: rgba(255, 250, 251, .88) !important;
  color: var(--final-maroon) !important;
  border: 1px solid rgba(255,255,255,.74) !important;
}

/* --------------------------------------------------------------------------
   Utility pages: remove fixed blank areas beneath the header.
   -------------------------------------------------------------------------- */
body.page-cart .cart-page {
  margin-top: 0 !important;
  padding-top: calc(var(--final-header-height) + 24px) !important;
  padding-bottom: clamp(42px, 6vw, 72px) !important;
  min-height: auto !important;
}

body.page-product .product-detail-section {
  margin-top: 0 !important;
  padding-top: calc(var(--final-header-height) + 24px) !important;
  padding-bottom: clamp(38px, 6vw, 68px) !important;
}

body.page-product .footer,
body.page-cart .footer {
  margin-top: clamp(18px, 3vw, 36px) !important;
}

/* --------------------------------------------------------------------------
   Professional interaction layer. Motion runs only on real hover devices.
   -------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .feature-card,
  .why-card,
  .product-card,
  .about-feature-item,
  .founder-block,
  .gallery-item,
  .contact-form-container,
  .contact-info,
  .map-card,
  .review-card,
  .newsletter-box {
    will-change: transform;
  }

  .feature-card:hover,
  .why-card:hover,
  .product-card:hover,
  .about-feature-item:hover,
  .gallery-item:hover,
  .contact-form-container:hover,
  .contact-info:hover,
  .map-card:hover,
  .review-card:hover {
    transform: translateY(-5px) !important;
  }

  .gallery-item:hover img,
  .gallery-preview-grid a:hover img,
  .product-card:hover img,
  .feature-card:hover img,
  .founder-image:hover img,
  .about-preview-image:hover img {
    transform: scale(1.035) !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .feature-card:hover,
  .why-card:hover,
  .product-card:hover,
  .about-feature-item:hover,
  .founder-block:hover,
  .gallery-item:hover,
  .contact-form-container:hover,
  .contact-info:hover,
  .map-card:hover,
  .review-card:hover,
  .testimonial-card:hover {
    transform: none !important;
  }

  .gallery-item:hover img,
  .gallery-preview-grid a:hover img,
  .product-card:hover img,
  .feature-card:hover img,
  .founder-image:hover img,
  .about-preview-image:hover img {
    transform: none !important;
    filter: none !important;
  }
}

/* --------------------------------------------------------------------------
   Tablet and mobile geometry.
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  :root {
    --final-header-height: 98px;
    --final-logo-size: 74px;
    --final-page-gutter: clamp(14px, 3.5vw, 24px);
  }

  header.navbar .nav-container,
  header.navbar.scrolled .nav-container,
  header.navbar.polish-scrolled .nav-container {
    width: calc(100% - 24px) !important;
    max-width: 820px !important;
  }

  body.page-index header.navbar .nav-container,
  body.page-about header.navbar .nav-container,
  body.page-gallery header.navbar .nav-container,
  body.page-shop header.navbar .nav-container,
  body.page-contact header.navbar .nav-container,
  body.page-cart header.navbar .nav-container,
  body.page-product header.navbar .nav-container {
    width: calc(100% - 24px) !important;
    max-width: 820px !important;
    margin-inline: 12px !important;
  }

  header.navbar .logo,
  header.navbar.scrolled .logo,
  header.navbar.polish-scrolled .logo {
    position: absolute !important;
    inset: 0 !important;
    margin: auto !important;
    transform: none !important;
  }

  header.navbar .nav-right,
  header.navbar.scrolled .nav-right,
  header.navbar.polish-scrolled .nav-right {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    pointer-events: none !important;
  }

  header.navbar .nav-right > *,
  header.navbar.scrolled .nav-right > *,
  header.navbar.polish-scrolled .nav-right > * {
    pointer-events: auto !important;
  }

  .hero-overlay {
    padding-top: calc(var(--final-header-height) + 20px) !important;
  }

  body.page-index .hero {
    min-height: max(680px, 100svh) !important;
  }

  body.page-about .hero { height: 540px !important; min-height: 540px !important; }
  body.page-shop .hero { height: 540px !important; min-height: 540px !important; }
  body.page-gallery .hero { height: 470px !important; min-height: 470px !important; }
  body.page-contact .hero { height: 480px !important; min-height: 480px !important; }

  body.page-about .hero-content,
  body.page-gallery .hero-content,
  body.page-shop .hero-content,
  body.page-contact .hero-content {
    width: min(100%, 720px) !important;
    max-width: 720px !important;
  }

  body.page-cart .cart-page,
  body.page-product .product-detail-section {
    padding-top: calc(var(--final-header-height) + 28px) !important;
  }
}

@media (max-width: 600px) {
  :root {
    --final-header-height: 94px;
    --final-logo-size: 70px;
    --final-page-gutter: 14px;
  }

  header.navbar .cart-icon,
  header.navbar .menu-toggle {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    flex-basis: 42px !important;
  }

  body.page-index .hero-content {
    width: min(100% - 22px, 540px) !important;
    padding: 1.35rem 1.15rem !important;
  }

  body.page-about .hero { height: 525px !important; min-height: 525px !important; }
  body.page-shop .hero { height: 535px !important; min-height: 535px !important; }
  body.page-gallery .hero { height: 445px !important; min-height: 445px !important; }
  body.page-contact .hero { height: 465px !important; min-height: 465px !important; }

  body.page-about .hero-overlay,
  body.page-gallery .hero-overlay,
  body.page-shop .hero-overlay,
  body.page-contact .hero-overlay {
    padding-top: calc(var(--final-header-height) + 24px) !important;
    padding-bottom: 24px !important;
  }

  body.page-about .hero-content,
  body.page-gallery .hero-content,
  body.page-shop .hero-content,
  body.page-contact .hero-content {
    width: calc(100% - 8px) !important;
    padding: 1.22rem 1rem !important;
    border-radius: 20px !important;
  }

  body.page-about .hero-subtitle,
  body.page-gallery .hero-subtitle,
  body.page-shop .hero-subtitle,
  body.page-contact .hero-subtitle {
    margin-bottom: .25rem !important;
  }

  /* Tighter but still breathable mobile sections. */
  .section,
  .features,
  .about-preview,
  .about-page,
  .gallery-page,
  .shop-page,
  .contact-page,
  .product-detail-section,
  .cart-page,
  .instagram-feed,
  .newsletter,
  .testimonials,
  .achievements {
    padding-top: clamp(2.15rem, 7vw, 2.8rem) !important;
    padding-bottom: clamp(2.15rem, 7vw, 2.8rem) !important;
  }

  body.page-cart .cart-page,
  body.page-product .product-detail-section {
    padding-top: calc(var(--final-header-height) + 24px) !important;
  }

  .section-title,
  .page-title {
    margin-bottom: 1.15rem !important;
  }

  .page-subtitle,
  .section-subtitle {
    margin-bottom: 1.45rem !important;
  }

  .founder-block,
  .founder-block.reverse,
  .contact-form-container,
  .contact-info,
  .map-card,
  .cart-panel,
  .summary-panel,
  .detail-card,
  .newsletter-box {
    border-radius: 18px !important;
  }

  .founder-block,
  .founder-block.reverse {
    gap: 1rem !important;
    margin-bottom: 1.25rem !important;
  }

  .founder-image {
    min-height: 0 !important;
  }

  .founder-image img,
  .about-preview-image img {
    width: 100% !important;
    max-height: 390px !important;
    object-fit: cover !important;
  }

  .gallery-item,
  .gallery-item.signature {
    min-height: 0 !important;
    aspect-ratio: 4 / 3 !important;
  }

  .gallery-item.signature::after {
    top: 10px !important;
    left: 10px !important;
    font-size: .66rem !important;
    padding: .4rem .66rem !important;
  }

  .footer {
    margin-top: 1.25rem !important;
  }
}

@media (max-width: 390px) {
  :root {
    --final-header-height: 90px;
    --final-logo-size: 66px;
    --final-page-gutter: 12px;
  }

  body.page-about .hero { height: 525px !important; min-height: 525px !important; }
  body.page-shop .hero { height: 545px !important; min-height: 545px !important; }
  body.page-gallery .hero { height: 440px !important; min-height: 440px !important; }
  body.page-contact .hero { height: 465px !important; min-height: 465px !important; }

  body.page-about .hero-content,
  body.page-gallery .hero-content,
  body.page-shop .hero-content,
  body.page-contact .hero-content {
    padding: 1.12rem .92rem !important;
  }

  body.page-cart .cart-page,
  body.page-product .product-detail-section {
    padding-top: calc(var(--final-header-height) + 22px) !important;
  }
}

@media (max-width: 340px) {
  header.navbar .nav-container,
  header.navbar.scrolled .nav-container,
  header.navbar.polish-scrolled .nav-container {
    width: calc(100% - 20px) !important;
  }


  body.page-index header.navbar .nav-container,
  body.page-about header.navbar .nav-container,
  body.page-gallery header.navbar .nav-container,
  body.page-shop header.navbar .nav-container,
  body.page-contact header.navbar .nav-container,
  body.page-cart header.navbar .nav-container,
  body.page-product header.navbar .nav-container {
    width: calc(100% - 20px) !important;
    margin-inline: 10px !important;
  }

  :root {
    --final-header-height: 86px;
    --final-logo-size: 62px;
    --final-page-gutter: 10px;
  }

  body.page-about .hero { height: 550px !important; min-height: 550px !important; }
  body.page-shop .hero { height: 565px !important; min-height: 565px !important; }
  body.page-gallery .hero { height: 440px !important; min-height: 440px !important; }
  body.page-contact .hero { height: 480px !important; min-height: 480px !important; }
}

/* Landscape phones need room for content without oversized empty hero space. */
@media (max-width: 860px) and (max-height: 620px) and (orientation: landscape) {
  :root {
    --final-header-height: 82px;
    --final-logo-size: 62px;
  }

  body.page-index .hero,
  body.page-about .hero,
  body.page-gallery .hero,
  body.page-shop .hero,
  body.page-contact .hero {
    height: auto !important;
    min-height: 520px !important;
  }

  .hero-overlay {
    position: relative !important;
    min-height: 520px !important;
    padding-top: calc(var(--final-header-height) + 18px) !important;
    padding-bottom: 24px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-content {
    animation: none !important;
  }
}
