/* =========================================================
   PALATIO PREMIUM HEADER v1.2 — palatio-header.css
   Layout: Logo center top + Nav+CTA center bottom row
   Elementor Header Template compatible (sticky = Elementor)
   ========================================================= */

:root {
  --ph-bg:           #ffffff;
  --ph-text:         #1a1a1a;
  --ph-text-muted:   #5a5a5a;
  --ph-cta-bg:       #1a1a1a;
  --ph-cta-text:     #ffffff;
  --ph-cta-hover:    #3d3d3d;
  --ph-border:       rgba(26,26,26,0.10);
  --ph-dropdown-bg:  #ffffff;
  --ph-shadow:       0 8px 40px rgba(0,0,0,0.07);
  --ph-font-serif:   'Cormorant Garamond', 'Georgia', serif;
  --ph-font-script:  'Great Vibes', 'Dancing Script', cursive;
  --ph-font-ui:      'Jost', 'Helvetica Neue', sans-serif;
}

/* ─── WRAPPER ───────────────────────────────────────────────────────────── */
/*
   VAŽNO: position NI sticky/fixed — to nastavi Elementor v
   Header Template > Settings > Sticky Header.
   Plugin samo izriše HTML, Elementor skrbi za pozicioniranje.
*/
.palatio-header {
  background: var(--ph-bg);
  width: 100%;
  border-bottom: 1px solid var(--ph-border);
}

/* Scrolled state — Elementor doda razred .elementor-sticky--active */
.elementor-sticky--active .palatio-header,
.palatio-header.is-scrolled {
  box-shadow: var(--ph-shadow);
}

/* ─── 2-VRSTIČNI LAYOUT ─────────────────────────────────────────────────── */
.palatio-header__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 40px 0;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

/* ─── VRSTICA 1: LOGO (center) ──────────────────────────────────────────── */
.palatio-header__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  margin-bottom: 12px;
}

.palatio-header__brand img,
.palatio-header__brand .custom-logo {
  max-height: 60px;
  width: auto;
}

/* Naslov logota — sans-serif uppercase spaced */
.palatio-header__brand-text {
  font-family: var(--ph-font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ph-text);
  text-transform: uppercase;
  line-height: 1;
  display: block;
}

/* Podnaslov logota — script font */
.palatio-header__brand-sub {
  font-family: var(--ph-font-script);
  font-size: 16px;
  font-weight: 400;
  color: var(--ph-text-muted);
  letter-spacing: 0.02em;
  margin-top: 4px;
  display: block;
}

/* ─── VRSTICA 2: NAV + CTA (v isti vrstici, na sredini) ─────────────────── */
.palatio-header__nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-top: 1px solid var(--ph-border);
  padding: 0;
  position: relative;
  min-height: 52px;
}

/* CTA pozicioniran absolutno desno znotraj nav-row */
.palatio-header__actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── DESKTOP NAV ───────────────────────────────────────────────────────── */
.palatio-header__desktop-nav {
  display: flex;
  align-items: center;
}

.palatio-desktop-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.palatio-desktop-menu-list > li {
  position: relative;
}

/* Nav linki */
.palatio-desktop-menu-list > li > a {
  font-family: var(--ph-font-ui);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ph-text-muted);
  text-decoration: none;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  transition: color 0.2s ease;
  white-space: nowrap;
}

/* Underline animacija */
.palatio-desktop-menu-list > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1.5px;
  background: var(--ph-text);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}

.palatio-desktop-menu-list > li > a:hover,
.palatio-desktop-menu-list > li.current-menu-item > a,
.palatio-desktop-menu-list > li.current-menu-ancestor > a {
  color: var(--ph-text);
}

/* Aktiven link ima vedno underline */
.palatio-desktop-menu-list > li.current-menu-item > a::after,
.palatio-desktop-menu-list > li.current-menu-ancestor > a::after {
  transform: scaleX(1);
}

.palatio-desktop-menu-list > li > a:hover::after {
  transform: scaleX(1);
}

/* Puščica za dropdown parent */
.palatio-desktop-menu-list > li.menu-item-has-children > a .ph-arrow {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.palatio-desktop-menu-list > li.menu-item-has-children:hover > a .ph-arrow {
  transform: rotate(-135deg) translateY(1px);
}

/* ─── DROPDOWN ──────────────────────────────────────────────────────────── */
/*
   Full-width dropdown: izstopi iz li konteksta in se razpne čez cel header.
   Pozicioniran relativno na .palatio-header (ne na li), zato potrebujemo
   overflow: visible na celotni navigacijski verigi.
*/
.palatio-header__desktop-nav,
.palatio-desktop-menu-list,
.palatio-desktop-menu-list > li {
  overflow: visible;
}

.palatio-desktop-menu-list > li > .sub-menu {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;

  background: var(--ph-dropdown-bg);
  border-top: 1px solid var(--ph-border);
  border-bottom: 1px solid var(--ph-border);
  box-shadow: var(--ph-shadow);

  /*
   * Background ostane 100% width.
   * Vsebina se vizualno omeji na max 1200px.
   */
  padding-top: 22px;
  padding-bottom: 18px;
  padding-left: max(60px, calc((100vw - 1200px) / 2));
  padding-right: max(60px, calc((100vw - 1200px) / 2));

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 16px;

  max-width: none;
  list-style: none;
  margin: 0;

  z-index: 99990;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Vsak element zapolni svoj stolpec. */
.palatio-desktop-menu-list > li > .sub-menu > li {
  width: 100%;
  min-width: 0;
  text-align: center;
}

/* Besedilo povezave je horizontalno in vertikalno na sredini. */
.palatio-desktop-menu-list > li > .sub-menu > li > a {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  text-align: center;
}

/* Pseudo-element premosti gap med nav linkom in dropdownom —
   miška ne "pade" v praznino in dropdown ostane odprt */
.palatio-desktop-menu-list > li.menu-item-has-children::after {
  content: '';
  position: absolute;
  bottom: -12px;   /* enako kot padding-bottom bridge */
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

.palatio-desktop-menu-list > li:hover > .sub-menu,
.palatio-desktop-menu-list > li:focus-within > .sub-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.palatio-desktop-menu-list > li > .sub-menu > li > a {
  font-family: var(--ph-font-serif);
  font-size: 16px;
  font-style: italic;
  font-weight: 600;
  color: var(--ph-text-muted);
  text-decoration: none;
  padding: 9px 10px;
  border-left: 2px solid transparent;
  display: block;
  transition: color 0.18s, border-color 0.18s, padding-left 0.18s;
  line-height: 1.3;
}

.palatio-desktop-menu-list > li > .sub-menu > li > a:hover {
  color: var(--ph-text);
  border-left-color: var(--ph-text);
  padding-left: 16px;
}

/* ─── CTA GUMB ──────────────────────────────────────────────────────────── */
/*
   Privzeto: transparentno ozadje, črn tekst, tanek border
   Hover: polno črno ozadje, bel tekst (kot prej) + puščica
*/
.palatio-header__cta {
  font-family: var(--ph-font-ui);
  font-size: 12px !important;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ph-text);
  background: transparent;
  border: 1px solid var(--ph-text);
  padding: 9px 19px;          /* -1px zaradi bordera */
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  transition: background 0.22s ease, color 0.22s ease, gap 0.2s;
  white-space: nowrap;
}

.palatio-header__cta::after {
  content: '→';
  font-size: 12px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.2s, opacity 0.2s;
}

.palatio-header__cta:hover {
  background: var(--ph-cta-bg);
  color: var(--ph-cta-text);
  gap: 8px;
}

.palatio-header__cta:hover::after {
  max-width: 20px;
  opacity: 1;
}

/* ─── HAMBURGER (skrit na desktopU) ─────────────────────────────────────── */
.palatio-header__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  outline: none;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.palatio-header__toggle:hover,
.palatio-header__toggle:focus,
.palatio-header__toggle:focus-visible,
.palatio-header__toggle:active,
.palatio-header__toggle[aria-expanded="true"],
.palatio-header__toggle[aria-expanded="false"] {
  background: transparent;
  border: none;
  box-shadow: none;
  outline: none;
}

.palatio-header__toggle-line {
  display: block;
  width: 23px;
  height: 1.5px;
  background: var(--ph-text);
  border-radius: 1px;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.palatio-header__toggle[aria-expanded="true"] .palatio-header__toggle-line:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}
.palatio-header__toggle[aria-expanded="true"] .palatio-header__toggle-line:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* ─── MOBILE MENI ───────────────────────────────────────────────────────── */
.palatio-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(26,26,26,0.3);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.palatio-mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.palatio-mobile-menu__panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(360px, 85vw);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

.palatio-mobile-menu.is-open .palatio-mobile-menu__panel {
  transform: translateX(0);
}

.palatio-mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  border-bottom: 1px solid var(--ph-border);
  flex-shrink: 0;
}

.palatio-mobile-menu__brand {
  font-family: var(--ph-font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ph-text);
  text-decoration: none;
}

.palatio-mobile-menu__close {
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--ph-border);
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.palatio-mobile-menu__close span {
  position: absolute;
  width: 15px;
  height: 1.5px;
  background: var(--ph-text);
}
.palatio-mobile-menu__close span:first-child { transform: rotate(45deg); }
.palatio-mobile-menu__close span:last-child  { transform: rotate(-45deg); }

.palatio-mobile-menu__nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.palatio-mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.palatio-mobile-menu-list > li > a {
  font-family: var(--ph-font-ui);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ph-text-muted);
  text-decoration: none;
  padding: 15px 24px;
  border-bottom: 1px solid var(--ph-border);
  display: block;
  transition: color 0.2s, padding-left 0.2s;
}

.palatio-mobile-menu-list > li > a:hover,
.palatio-mobile-menu-list > li.current-menu-item > a {
  color: var(--ph-text);
  padding-left: 32px;
}

.palatio-mobile-menu-list .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(26,26,26,0.02);
}

.palatio-mobile-menu-list .sub-menu li a {
  font-family: var(--ph-font-serif);
  font-size: 15px;
  font-style: italic;
  color: var(--ph-text-muted);
  text-decoration: none;
  padding: 11px 24px 11px 40px;
  border-bottom: 1px solid var(--ph-border);
  display: block;
  transition: color 0.2s, padding-left 0.2s;
}

.palatio-mobile-menu-list .sub-menu li a:hover {
  color: var(--ph-text);
  padding-left: 48px;
}

.palatio-mobile-menu__footer {
  padding: 20px 24px;
  border-top: 1px solid var(--ph-border);
  flex-shrink: 0;
}

.palatio-mobile-menu__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--ph-font-ui);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--ph-cta-bg);
  padding: 14px 20px;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.2s;
}

.palatio-mobile-menu__cta:hover { background: var(--ph-cta-hover); }
.palatio-mobile-menu__cta::after { content: '→'; }

/* ─── RESPONSIVE ────────────────────────────────────────────────────────── */

/* Tablet ≤ 1024px */
@media (max-width: 1024px) {
  .palatio-header__inner {
    padding: 16px 28px 0;
  }
  
  .palatio-desktop-menu-list > li > .sub-menu {
      grid-template-columns: repeat(3, 1fr);
  }

  .palatio-desktop-menu-list > li > a {
    padding: 16px 14px;
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .palatio-header__brand-text {
    font-size: 24px;
  }

  /*
     Tablet CTA: minimalistični icon-only gumb z kaligrafsko puščico.
     Ohranja isti ghost stil kot desktop, ampak brez teksta.
     Hover razkrije tekst z animacijo.
  */
.palatio-header__cta {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    font-size: 10px !important;
    font-weight: 500 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    line-height: 1 !important;

    padding: 10px 13px !important;
    gap: 7px !important;

    min-width: auto !important;
    min-height: 36px !important;

    border: 1px solid var(--ph-text) !important;

    color: var(--ph-text) !important;
    background: transparent !important;

    text-decoration: none !important;
    white-space: nowrap !important;

    position: relative !important;
    overflow: hidden !important;
  }

  .palatio-header__cta::after {
    content: '→';
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    font-family: var(--ph-font-serif);
    color: currentColor;
  }

  .palatio-header__cta:active,
  .palatio-header__cta:focus-visible {
    background: var(--ph-cta-bg) !important;
    color: var(--ph-cta-text) !important;
    border-color: var(--ph-cta-bg) !important;
  }
}

  /* Dropdown na tablici — enake popravke kot desktop (full-width, z-index) */
  /* Podeduje desktop pravila, ni potrebno ponavljati */

  /*
     Tablet touch: prvi tap odpre sub-menu, drugi tap gre na stran.
     To upravljamo prek JS razreda .touch-open na li elementu.
     CSS: pokaži sub-menu ko ima li razred .touch-open (ne samo :hover).
  */
  .palatio-desktop-menu-list > li.menu-item-has-children.touch-open > .sub-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }


/* Mobile ≤ 767px */
@media (max-width: 767px) {
  /*
     __inner postane flex ROW:
     [LOGO]  ............  [HAMBURGER]
     Hamburger je zdaj direktno v __inner (ne v nav-row), zato je vedno viden.
  */
  .palatio-header__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px 10px 20px;
    min-height: 60px;
  }

  /* Logo levo, ne centiran */
  .palatio-header__brand {
    align-items: flex-start;
    margin-bottom: 0;
    flex-shrink: 1;
    min-width: 0;
  }
  
  .palatio-mobile-menu__cta {
      font-size: 14px !important;
  }

  .palatio-header__brand-text {
    font-size: 20px;
  }

  .palatio-header__brand-sub {
    font-size: 13px;
  }

  /* Nav vrstica skrita — hamburger je zdaj direktno v __inner */
  .palatio-header__nav-row {
    display: none;
  }

  /* Hamburger — vedno prikazan na mobilnem, absolutno pozicioniranje odstranjeno */
.palatio-header__toggle {
  display: flex;
  position: static;
  flex-shrink: 0;
  margin-left: auto;   /* potisne desno tudi če brand nima margin */
}

} /* konec @media (max-width: 767px) */


/* ─── BODY LOCK ─────────────────────────────────────────────────────────── */
body.palatio-menu-open {
  overflow: hidden;
}

/* ─── ELEMENTOR SPECIFIKE ───────────────────────────────────────────────── */
/*
   Elementor Header template wrapper ima privzeto margin/padding.
   Resetiramo, da naš header zapolni cel prostor.
*/
.elementor-location-header .elementor-container,
.elementor-location-header .elementor-column,
.elementor-location-header .elementor-widget-container {
  padding: 0 !important;
  margin: 0 !important;
}

.elementor-location-header .elementor-section,
.elementor-location-header .e-con {
  padding: 0 !important;
}

/* Preglasi Elementor kit styles za close gumb */
.elementor-kit-8 button.palatio-mobile-menu__close,
.elementor-kit-8 button.palatio-mobile-menu__close:hover,
.elementor-kit-8 button.palatio-mobile-menu__close:focus,
.elementor-kit-8 button.palatio-mobile-menu__close:focus-visible,
.elementor-kit-8 button.palatio-mobile-menu__close:active {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
  color: var(--ph-text);
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  outline: none;
  padding: 0;
}

/* =========================================================
   PALATIO HEADER - HOMEPAGE HERO LAYOUT ONLY
   Does not change colors, typography, buttons or dropdowns.
   ========================================================= */

body.home .elementor-location-header,
body.front-page .elementor-location-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
}

body.home .palatio-header,
body.front-page .palatio-header {
  position: relative;
  width: 100%;
  z-index: 9999;
}

body.home .palatio-mobile-hero,
body.front-page .palatio-mobile-hero {
  min-height: 100vh;
  min-height: 100svh;
}

</style>
