/*
 * Cutegory brand typography and header (CUT-2466).
 * Fonts and #0a0a0a / #fff header colors match cutegory-web.
 * CSS overlay for the current Dolomit template, no layout changes.
 */

/* =========================================================
   1. TYPOGRAPHY
   ========================================================= */

@font-face {
    font-family: 'StabilGrotesk';
    src: url('fonts/StabilGrotesk-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'StabilGrotesk';
    src: url('fonts/StabilGrotesk-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'StabilGrotesk';
    src: url('fonts/StabilGrotesk-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'StabilGrotesk';
    src: url('fonts/StabilGrotesk-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'StabilGrotesk';
    src: url('fonts/StabilGrotesk-Medium.woff2') format('woff2');
    font-weight: 500 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'StabilGrotesk';
    src: url('fonts/StabilGrotesk-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'StabilGrotesk';
    src: url('fonts/StabilGrotesk-BoldItalic.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* Apply Shoptet CSS variables */
html:root {
    --template-font: 'StabilGrotesk', system-ui, sans-serif;
    --template-headings-font: 'StabilGrotesk', system-ui, sans-serif;
}

/* Targeted application avoiding universal selectors and icon fonts */
html body,
html.external-fonts-loaded body,
html input,
html button,
html select,
html textarea,
html .form-control {
    font-family: var(--template-font);
}

/* Overrides for specific fixed template fonts */
html .support button,
html .support .menu {
    font-family: var(--template-font);
}

/* Dolomit literal plus submenu arrow override */
.menu-helper > ul li a .submenu-arrow:after {
    font-family: var(--template-font) !important;
}

/* =========================================================
   2. DESKTOP TOP NAVIGATION BAR
   ========================================================= */

.top-navigation-bar {
    color: #fff;
    background-color: #0a0a0a;
    border-bottom-color: #0a0a0a;
}

/* Logo inversion (Black to White) */
.top-navigation-bar .site-name img {
    filter: brightness(0) invert(1);
}

/* Base text color to white */
.top-navigation-bar a,
.top-navigation-bar .top-navigation-menu .top-navigation-bar-menu > li > a,
.top-navigation-bar .top-nav-button,
.top-navigation-bar [data-target="search"],
.top-navigation-bar [data-target="login"],
.top-navigation-bar [data-target="navigation"] {
    color: #fff;
}

/* Explicit colors for pseudo-elements and triggers */
.top-navigation-bar [data-target="search"]:before,
.top-navigation-bar [data-target="login"]:before,
.top-navigation-bar [data-target="navigation"]:before,
.top-navigation-bar .top-nav-button:before,
.top-navigation-bar .dropdown button:after {
    color: #fff;
}

/* SVG background pseudo-element inversions */
.top-navigation-bar .top-navigation-contacts a:before,
.top-navigation-bar .header-socials a:before,
.top-navigation-bar .top-navigation-menu-trigger:before {
    filter: brightness(0) invert(1);
}

/* Keep primary hover brand pink */
.top-navigation-bar a:hover,
.top-navigation-bar .top-navigation-menu .top-navigation-bar-menu > li > a:hover,
.top-navigation-bar .top-nav-button:hover,
.top-navigation-bar [data-target="search"]:hover,
.top-navigation-bar [data-target="login"]:hover,
.top-navigation-bar [data-target="navigation"]:hover {
    color: var(--color-primary);
}

/* Keep hover match on structural icons */
.top-navigation-bar [data-target="search"]:hover:before,
.top-navigation-bar [data-target="login"]:hover:before,
.top-navigation-bar [data-target="navigation"]:hover:before,
.top-navigation-bar .top-nav-button:hover:before,
.top-navigation-bar .dropdown button:hover:after {
    color: var(--color-primary);
}

/* =========================================================
   3. DROPDOWN PANELS (Keep light mode inside #0a0a0a context)
   ========================================================= */

/* Preserve light popup surfaces inside the dark bar. */
.top-navigation-bar .top-navigation-bar-menu-helper,
.top-navigation-bar .dropdown-menu {
    background-color: #fff;
    color: #0a0a0a;
}

/* Existing helper links use !important, so match it narrowly. */
.top-navigation-bar .top-navigation-bar-menu-helper li a,
.top-navigation-bar .dropdown-menu a {
    color: #0a0a0a !important;
}

/* Hover remains brand pink */
.top-navigation-bar .top-navigation-bar-menu-helper li a:hover,
.top-navigation-bar .dropdown-menu a:hover {
    color: var(--color-primary) !important;
}

/* Dolomit moves the logo into #header only below 768px on page load.
   Its mobile header has an existing white !important background. */
@media only screen and (max-width: 767px) {
    html #header {
        background-color: #0a0a0a !important;
        border-bottom-color: #0a0a0a;
    }

    #header .header-top {
        background-color: #0a0a0a;
        color: #fff;
    }

    #header .header-top .site-name img {
        filter: brightness(0) invert(1);
    }

    #header .header-top .responsive-tools a,
    #header .header-top .responsive-tools a[data-target="navigation"]:before {
        color: #fff;
    }

    /* These controls use SVG backgrounds, not icon-font glyphs. */
    #header .header-top .responsive-tools a[data-target="search"]:before,
    #header .header-top .responsive-tools a[data-target="login"]:before,
    #header .navigation-buttons .btn.cart-count:before {
        filter: brightness(0) invert(1);
    }

    #header .navigation-buttons .btn.cart-count {
        background-color: transparent;
        color: #fff !important;
    }
}

/* CUT-2472: Expressive Cutegory Shoptet footer */

#footer {
  background-color: #1a1a1a;
  color: #ffffff;
  border: none;
  position: relative;
}

/* Link transitions & focus states */
#footer a {
  color: #ffffff;
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: color 0.2s ease, outline 0.2s ease;
  outline-offset: 4px;
}

#footer a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: #e31d75;
  text-underline-offset: 0.22em;
}

#footer a:focus-visible {
  outline: 2px solid #ffffff;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: #e31d75;
  text-underline-offset: 0.22em;
}

/* Headings */
#footer h3 {
  color: #ffffff;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* Dolomit assigns a light-theme color directly to the footer text nodes.
   Scope their foreground overrides to the existing contact and legal blocks. */
#footer .custom-footer .contact-box ul li > span,
#footer .custom-footer .contact-box ul li > span > a,
#footer .custom-footer .custom-footer__articles li > a,
#footer .custom-footer .pageElement__heading > span {
  color: #ffffff !important;
}

#footer .custom-footer .contact-box ul li > span > a:hover,
#footer .custom-footer .contact-box ul li > span > a:focus-visible,
#footer .custom-footer .custom-footer__articles li > a:hover,
#footer .custom-footer .custom-footer__articles li > a:focus-visible {
  color: #ffffff !important;
  text-decoration: underline;
  text-decoration-color: #e31d75;
  text-underline-offset: 0.22em;
}

/* Logo display override */
#footer .site-name {
  display: block !important;
  padding: 0 !important;
  clear: none;
  min-width: 0;
}

#footer .site-name img {
  width: 100%;
  max-width: 380px;
  max-height: none;
  height: auto;
  filter: brightness(0) invert(1);
}

/* Base structural grid */
#footer .footer-rows.container {
  display: grid;
  padding: 40px 24px !important;
  max-width: 1280px;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem 2rem;
}

/* Medium layout (768px - 1100px) */
@media (min-width: 768px) {
  #footer .footer-rows.container {
    padding: 60px 24px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #footer .site-name {
    grid-column: 1 / -1;
  }
}

/* Desktop layout (1101px+) */
@media (min-width: 1101px) {
  #footer .footer-rows.container {
    padding: 80px 24px !important;
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  }
  #footer .site-name {
    grid-column: auto;
  }
}

/* Flatten Dolomit's inner wrappers to join the grid */
#footer .custom-footer.elements-2 {
  display: contents;
}

/* Reset Dolomit's aggressive column widths, paddings, and borders */
#footer .custom-footer.elements-2 > .custom-footer__contact,
#footer .custom-footer.elements-2 > .custom-footer__articles {
  width: auto !important;
  padding: 0 !important;
  border: none !important;
  margin: 0 !important;
}

/* Contact & Legal link resets */
#footer .custom-footer__contact ul,
#footer .custom-footer__articles ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Tactile targets for contact block */
#footer .custom-footer__contact li {
  margin-bottom: 1rem;
}

#footer .custom-footer__contact .tel a {
  font-size: 24px;
  font-weight: 700;
  display: inline-block;
  padding: 8px 0;
}

#footer .custom-footer__contact .mail a {
  font-size: 16px;
  display: inline-block;
  padding: 8px 0;
}

/* Icon glyph color fixes */
#footer .custom-footer__contact .contact-box ul li > span::before {
  color: #ffffff;
}

/* Tactile targets for article links */
#footer .custom-footer__articles li {
  margin-bottom: 0.5rem;
}

#footer .custom-footer__articles a {
  display: inline-block;
  padding: 8px 0;
  line-height: 24px;
}

/* CUT-2559: salon navigation in the existing contact column */
#footer .custom-footer__contact .cutegory-salon-links {
  margin-top: 2rem;
}

#footer .custom-footer__contact .cutegory-salon-links h3 {
  margin-bottom: 1rem;
}

#footer .custom-footer__contact .cutegory-salon-links li {
  margin-bottom: 0.25rem;
}

#footer .custom-footer__contact .cutegory-salon-links a {
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
  line-height: 24px;
  min-height: 44px;
  max-width: 100%;
  box-sizing: border-box;
}

#footer .custom-footer__contact .cutegory-salon-links a:hover,
#footer .custom-footer__contact .cutegory-salon-links a:focus-visible {
  color: #ffffff !important;
  text-decoration: underline;
  text-decoration-color: #e31d75;
  text-underline-offset: 0.22em;
}

#footer .custom-footer__contact .cutegory-salon-links a:focus-visible {
  outline: 2px solid #ffffff !important;
  outline-offset: 4px;
}

/* Footer Bottom (Copyright & Creator credits) */
#footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 24px !important;
  max-width: 1280px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}

#footer .copyright {
  display: contents;
  color: rgba(255, 255, 255, 0.85); /* > 4.5 contrast */
  font-size: 12px;
  text-align: center;
  opacity: 1 !important;
}

#footer #signature {
  order: 2;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  opacity: 1;
}

#footer #signature img {
  filter: brightness(0) invert(1);
}

#footer .copyright .podpis {
  color: rgba(255, 255, 255, 0.85);
}

#footer .copyright .cutegory-copyright {
  display: block;
  order: 1;
}

#footer .copyright .cutegory-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  order: 3;
  font-size: 12px;
}

#footer .copyright .cutegory-credit a {
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
}

#footer .copyright .cutegory-credit img {
  display: block;
  width: 120px;
  height: auto;
}

/* The original separator spans the viewport and uses a light-theme color. */
#footer .footer-bottom::before {
  display: none;
}

@media (min-width: 1024px) {
  #footer .footer-bottom {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 32px;
  }
  #footer .copyright .cutegory-copyright {
    text-align: left;
    white-space: nowrap;
  }
  #footer #signature {
    white-space: nowrap;
  }
  #footer .copyright .cutegory-credit {
    justify-content: flex-end;
  }
}

/* Canonical Pattern Banner */
#footer::after {
  content: '';
  display: block;
  width: 100%;
  height: clamp(9rem, 18vw, 20rem);
  background-image: url('brand/letter-pattern-horizontal-banner.svg');
  background-size: max(100%, 72rem) auto;
  background-position: center top;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  #footer a {
    transition: none;
  }
}
