/**
 * Custom stylesheet for Hello Maatos theme.
 *
 * Loaded after Tailwind output so rules here override utility classes when
 * needed.
 */

/* ---------------------------------------------------------------------------
 * Migrated from style.css
 * ------------------------------------------------------------------------ */

#site-header {
  padding: 1rem 0;
  max-width: none;
  top: 0;
  z-index: 1100; /* Higher than offcanvas-menu */
  background: var(--maatos-header-bg-color, #fff);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
}
body.admin-bar #site-header {
  top: 32px;
}
#site-header .header-container {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1rem;
}
#site-header a {
  color: var(--maatos-header-link-color, #383838);
  font-weight: 400;
}
#site-header button:hover,
#site-header a:hover {
  color: var(--maatos-header-link-hover-color, var(--maatos-theme-color, #000));
}
#site-header .site-navigation ul.menu li a {
  padding: 0.5rem;
}

/* Logo Left Layout */
.header-logo-left .header-container {
  flex-direction: row;
  justify-content: flex-start;
  gap: 1rem;
}
#site-header .custom-logo-link {
  max-width: 180px;
  display: block;
}
.custom-logo {
  display: block;
}

.header-logo-left .header-menu-right {
  margin-left: auto;
}

.header-logo-left .header-actions--push-right {
  margin-left: auto;
}

/* Logo Left Centered Links Layout */
.header-logo-left-centered .header-container {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.header-logo-left-centered .site-branding {
  flex: 0 0 auto;
}

.header-logo-left-centered .header-menu-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-logo-left-centered .header-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 1024px) {
  .header-logo-left-centered .header-menu-center {
    display: none !important;
  }
  .header-logo-left-centered .header-actions {
    margin-left: auto;
  }
}

/* Logo Center Layout */
.header-logo-center .header-container {
  flex-direction: row;
  justify-content: space-between;
}

.header-logo-center .header-side {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-logo-center .header-side-left {
  justify-content: flex-start;
}

.header-logo-center .header-side-right {
  justify-content: flex-end;
}

.header-logo-center .site-branding {
  flex: 0 0 auto;
  padding: 0;
}

@media (min-width: 768px) {
  .header-logo-center .site-branding {
    padding: 0 2rem;
  }
}

.header-logo-center .header-actions {
  margin-left: 0.5rem;
}

/* Basic menu styling */
.site-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
}

.site-navigation-toggle {
  display: none;
}

/* Burger Animation Variables */
:root {
  --mb-bar-width: 24px;
  --mb-bar-height: 2px;
  --mb-bar-spacing: 6px;
  --mb-animation-function: ease;
  --mb-animation-duration: 0.25s;
  --mb-animation-delay: 0s;
}

.mburger {
  padding: 0;
  margin: 0;
  font-size: inherit;
  color: inherit;
  border: unset;
  background: transparent;
  cursor: pointer;
  display: block;
  width: var(--mb-bar-width);
  height: calc(var(--mb-bar-height) * 3 + var(--mb-bar-spacing) * 2);
  position: relative;
  z-index: 1100;
}

.bar {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  height: var(--mb-bar-height);
  background: currentColor;
  color: inherit;
  opacity: 1;
  transition: all var(--mb-animation-duration) var(--mb-animation-function) var(--mb-animation-delay);
}

.bar--top {
  bottom: calc(50% + var(--mb-bar-spacing) + var(--mb-bar-height) / 2);
  transition-property: bottom, transform;
}

.bar--middle {
  top: calc(50% - var(--mb-bar-height) / 2);
  transition-property: opacity;
}

.bar--bottom {
  top: calc(50% + var(--mb-bar-spacing) + var(--mb-bar-height) / 2);
  transition-property: top, transform;
}

.is-cross .bar--top {
  bottom: calc(50% - var(--mb-bar-height) / 2);
  transform: rotate(45deg);
}

.is-cross .bar--middle {
  opacity: 0;
}

.is-cross .bar--bottom {
  top: calc(50% - var(--mb-bar-height) / 2);
  transform: rotate(-45deg);
}

/* Offcanvas Menu - Water Drop Expansion */
.offcanvas-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 1050;

  /* Initial state: small circle in top right */
  clip-path: circle(0% at calc(100% - 50px) 40px);
  transition: clip-path 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  pointer-events: none;
  visibility: hidden;
}

.offcanvas-menu.is-open {
  /* Final state: full screen coverage */
  clip-path: circle(150% at calc(100% - 50px) 40px);
  pointer-events: auto;
  visibility: visible;
}

.offcanvas-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1); /* Lighter since menu covers everything */
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.offcanvas-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.no-scroll {
  overflow: hidden;
}

.offcanvas-content {
  padding: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.fallback-menu-wrapper,
.offcanvas-content ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.offcanvas-content li {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.offcanvas-menu.is-open li {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation for menu items */
.offcanvas-menu.is-open li:nth-child(1) {
  transition-delay: 0.2s;
}
.offcanvas-menu.is-open li:nth-child(2) {
  transition-delay: 0.3s;
}
.offcanvas-menu.is-open li:nth-child(3) {
  transition-delay: 0.4s;
}
.offcanvas-menu.is-open li:nth-child(4) {
  transition-delay: 0.5s;
}
.offcanvas-menu.is-open li:nth-child(5) {
  transition-delay: 0.6s;
}

.offcanvas-content a {
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.1;
  padding: 0.5rem;
  display: inline-block;
  color: #383838;
  transition: color 0.3s ease;
}

.offcanvas-content a:hover {
  color: var(--maatos-theme-color, #f21562);
}

/* Header Actions (Search & Cart) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0;
}

.header-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  margin-right: 0.5rem;
}

.header-account .user-name {
  font-size: 14px;
  font-weight: 600;
}

.header-account .user-avatar img {
  border-radius: 50%;
  display: block;
}

/* Header Account Container */
.header-account-container {
  position: relative;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.02);
  margin-left: 0.5rem;
  padding: 5px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.account-toggle {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

.account-toggle .user-name {
  font-size: 14px;
  font-weight: 600;
  padding: 0 0.75rem;
}

.account-toggle .user-avatar img {
  border-radius: 50%;
  display: block;
}

.account-toggle .dropdown-icon {
  transition: transform 0.3s ease;
}

.account-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 280px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  z-index: 1200;
  display: none;
  margin-top: 15px;
  overflow: hidden;
}

.account-dropdown.is-active {
  display: block;
}

.account-dropdown-header {
  padding: 1rem;
  background: #f9f9f9;
  border-bottom: 1px solid #eee;
}

.account-dropdown-header .user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.account-dropdown-header .user-avatar-large img {
  border-radius: 50%;
}

.account-dropdown-header .display-name {
  font-weight: 700;
  color: #333;
  font-size: 16px;
}

.account-dropdown-header .user-email {
  font-size: 12px;
  color: #888;
}

.account-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.account-menu li a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.5rem;
  color: #555;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease;
}

.account-menu li a i,
.account-menu li a span.dashicons,
.account-menu li a svg {
  color: #888;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.account-menu li a:hover {
  background: #f5f5f5;
  color: var(--maatos-theme-color, #f21562);
}

.account-menu li a:hover i,
.account-menu li a:hover span.dashicons,
.account-menu li a:hover svg {
  color: var(--maatos-theme-color, #f21562);
}

.account-menu li.menu-item-logout {
  border-top: 1px solid #eee;
}

.header-search {
  position: relative;
}

.search-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: inherit;
  display: block;
  line-height: 1;
}

.header-search .search-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

.header-search-popup {
  position: absolute;
  top: 100%;
  right: 0;
  width: 300px;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  z-index: 100;
  display: none;
  margin-top: 10px;
}

.header-search-popup.is-active {
  display: block;
}

.header-search-popup form {
  display: flex;
}

.header-search-popup input[type='search'] {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  height: 100%;
  border-radius: 0;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  font-size: 14px;
}

.header-search-popup input[type='submit'] {
  background: var(--maatos-theme-color, #f21562);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

/* Header Cart */
.header-cart {
  position: relative;
  line-height: 1;
  padding: 0.5rem;
}

.header-cart .cart-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: block;
}

.header-cart .cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--maatos-theme-color, #f21562);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 1024px) {
  .site-navigation {
    display: none !important;
  }
  .site-navigation-toggle {
    display: block;
  }
  .header-logo-left .header-actions {
    margin-left: auto;
  }
}

.entry-title {
  display: none !important;
}

.wp-block-media-text__media img,
.wp-block-media-text__media video {
  width: 100%;
}

/* Footer Layout 1 */
.site-footer.footer-layout-1 {
  padding: 4rem 0 2rem;
}

.site-footer.footer-layout-1 a {
  color: inherit;
}

.site-footer.footer-layout-1 .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 4rem;
  align-items: flex-start;
  justify-content: space-between;
}

.site-footer.footer-layout-1 .footer-left {
  max-width: 460px;
}

.site-footer.footer-layout-1 .footer-branding .custom-logo-link {
  max-width: 200px;
  display: inline-block;
}

.site-footer.footer-layout-1 .footer-description {
  margin: 1.5rem 0 2rem;
  line-height: 1.7;
}

.site-footer.footer-layout-1 .footer-social {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.site-footer.footer-layout-1 .footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(var(--maatos-theme-color-rgb, 255, 255, 255), 0.2);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.site-footer.footer-layout-1 .footer-social a:hover {
  background: rgba(var(--maatos-theme-color-rgb, 255, 255, 255), 0.6);
}

.site-footer.footer-layout-1 .footer-social svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.site-footer.footer-layout-1 .footer-right {
  display: flex;
  gap: 4rem;
}

.site-footer.footer-layout-1 .footer-column {
  min-width: 160px;
}

/*.site-footer.footer-layout-1 .footer-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}*/

.site-footer.footer-layout-1 .footer-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.site-footer.footer-layout-1 .footer-navigation a {
}

.site-footer.footer-layout-1 .footer-navigation a:hover {
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}

.site-footer.footer-layout-1 .footer-bottom {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .site-footer.footer-layout-1 .footer-container {
    flex-direction: column;
    gap: 2.5rem;
  }

  .site-footer.footer-layout-1 .footer-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .site-footer.footer-layout-1 .footer-right {
    flex-direction: column;
  }
}

/* ---------------------------------------------------------------------------
 * Theme Custom Overrides
 * ------------------------------------------------------------------------ */

input:focus {
  outline: none;
}
.user-is-tabbing input:focus {
  outline: 2px solid #2563eb;
}

/* ---------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--maatos-button-color, var(--maatos-theme-color, #111));
  color: #fff;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease,
    border-color 0.2s ease;
  white-space: nowrap;
}

.btn:hover,
.btn:focus-visible {
  background: var(--maatos-button-hover-color, var(--maatos-theme-color, #000));
  color: #fff;
  text-decoration: none;
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Link-style button: no background, no border, just inherits text colour. */
.btn-link {
  background: transparent;
  border-color: transparent;
  color: inherit;
  padding: 0.625rem 0.5rem;
  font-weight: 500;
}

.btn-link:hover,
.btn-link:focus-visible {
  background: transparent;
  color: var(--maatos-theme-color, #000);
  text-decoration: underline;
}

/* Login Button Responsive Icon styling */
.header-login-btn .login-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: none;
  vertical-align: middle;
}

@media (max-width: 1024px) {
  .header-login-btn .login-text {
    display: none;
  }
  .header-login-btn .login-icon {
    display: inline-block;
  }
}

/* ---------------------------------------------------------------------------
 * Footer Styling (ACF Onboarding Options)
 * ------------------------------------------------------------------------ */
#site-footer {
  background-color: var(--maatos-footer-bg-color) !important;
}
#site-footer h1,
#site-footer h2,
#site-footer h3,
#site-footer h4,
#site-footer h5,
#site-footer h6,
#site-footer .footer-title {
  color: var(--maatos-footer-heading-color) !important;
}
#site-footer,
#site-footer p,
#site-footer a,
#site-footer li,
#site-footer span {
  color: var(--maatos-footer-text-color) !important;
}
