/* Shared styles for product and products pages */

body {
  overflow-x: hidden;
  overflow-y: auto;
}

.main {
  height: auto;
  min-height: 100vh;
  overflow: visible;
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Side image columns - shared layout */
.side-image-column {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 20%;
  display: flex;
  flex-direction: column;
  z-index: 0;
}

.side-image-column-left {
  left: 0;
}

.side-image-column-right {
  right: 0;
}

.side-image {
  flex: 1;
  width: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 1400px) {
  .side-image-column {
    width: 15%;
  }
}

@media (max-width: 1024px) {
  .side-image-column {
    display: none;
  }
}

/* Loading spinner - shared */
.loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-gray);
  font-size: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 50vh;
}

.loader {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(139, 111, 71, 0.2);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--warm-brown);
  font-size: 1.1rem;
}

/* Back link container - shared */
.back-link-container {
  position: fixed;
  top: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10;
}

/* Back link - shared */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: static;
  color: var(--warm-brown);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(139, 111, 71, 0.2);
}

.back-link:hover {
  color: var(--primary-green);
  background: rgba(250, 248, 245, 1);
  transform: translateX(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1024px) {
  .back-link-container {
    top: 1rem;
    left: 1rem;
    gap: 0.5rem;
  }

  .back-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  /* Move social buttons to right side on mobile */
  .back-link-container .social-links-top {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: auto;
    gap: 0.5rem;
  }

  .social-link-top {
    padding: 0.6rem;
    min-width: 40px;
  }

  .social-link-top svg {
    width: 18px;
    height: 18px;
  }
}

/* Desktop centered navigation - all buttons together */
.desktop-centered-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: none; /* Hidden by default */
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  flex-wrap: nowrap; /* Keep all buttons on one line */
  justify-content: center;
  min-width: 65vw; /* Wider than middle column (which is ~37-47% of viewport) */
  max-width: 95vw;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 12px 12px; /* Rounded corners only at bottom */
  background: rgba(250, 248, 245, 0.85); /* Semi-transparent background */
  backdrop-filter: blur(10px); /* Frosted glass effect */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(139, 111, 71, 0.2);
}

/* Hide on mobile by default */
@media (max-width: 1024px) {
  .desktop-centered-nav {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
}

/* Show desktop nav on desktop screens only */
@media (min-width: 1025px) {
  .desktop-centered-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    left: 50% !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
}

.desktop-centered-nav .contact-form-link {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Contact form link - base styles */
.contact-form-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  background: rgba(250, 248, 245, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(139, 111, 71, 0.3);
  border: 2px solid rgba(139, 111, 71, 0.4);
  text-align: center;
  line-height: 1.2;
  box-sizing: border-box;
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
  height: auto;
  min-height: 48px;
}

.contact-form-link:hover {
  background: rgba(250, 248, 245, 0.95);
  color: var(--text-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(139, 111, 71, 0.5);
  border-color: rgba(139, 111, 71, 0.6);
}

/* Products link - top left corner */
.products-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  background: rgba(250, 248, 245, 0.98); /* Semi-transparent background */
  backdrop-filter: blur(10px); /* Frosted glass effect */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(139, 111, 71, 0.3); /* Shadow and border */
  border: 2px solid rgba(139, 111, 71, 0.4); /* Border */
  text-align: center;
  line-height: 1.2;
  box-sizing: border-box;
  height: auto;
  min-height: 48px; /* Ensure consistent minimum height */
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap; /* Prevent text wrapping */
}

.products-link.active,
.about-link.active {
  background: var(--primary-green);
  color: var(--text-dark);
  border-color: var(--primary-green);
  box-shadow: 0 4px 20px rgba(183, 211, 51, 0.4),
    0 0 0 2px rgba(183, 211, 51, 0.3);
}

/* About link button - same style as products link */
button.products-link,
.about-link {
  border: 2px solid rgba(139, 111, 71, 0.4);
  background: rgba(250, 248, 245, 0.98);
}

.products-link:hover {
  color: var(--primary-green);
  background: rgba(250, 248, 245, 1); /* Full opacity on hover */
  transform: translateY(-2px); /* Lift effect */
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(183, 211, 51, 0.5); /* Stronger shadow with green border hint */
  border-color: rgba(183, 211, 51, 0.6); /* Green border on hover */
}

/* Social links in top left */
.social-links-top {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.social-link-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 48px;
  padding: 0.85rem;
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--transition-smooth);
  border-radius: 8px;
  background: rgba(250, 248, 245, 0.98); /* Semi-transparent background */
  backdrop-filter: blur(10px); /* Frosted glass effect */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(139, 111, 71, 0.3); /* Shadow and border */
  border: 2px solid rgba(139, 111, 71, 0.4); /* Border */
  box-sizing: border-box;
  height: auto;
  min-height: 48px; /* Ensure consistent minimum height */
}

.social-link-top:hover {
  color: var(--primary-green);
  background: rgba(250, 248, 245, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(183, 211, 51, 0.5);
  border-color: rgba(183, 211, 51, 0.6);
}

/* Burger Menu Button (Mobile Only) */
.burger-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  width: auto;
  min-width: 48px;
  height: 48px;
  padding: 0.85rem;
  background: rgba(250, 248, 245, 0.98);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(139, 111, 71, 0.4);
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(139, 111, 71, 0.3);
  transition: var(--transition-smooth);
  box-sizing: border-box;
}

.burger-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: var(--transition-smooth);
}

.burger-menu-btn:hover:not(.active) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.burger-menu-btn:focus {
  outline: none;
}

.burger-menu-btn:focus-visible:not(.active) {
  outline: 2px solid rgba(139, 111, 71, 0.4);
  outline-offset: 2px;
}

/* Green styling only when menu is open (active) */
.burger-menu-btn.active,
.burger-menu-btn.active:hover,
.burger-menu-btn.active:focus {
  background: var(--primary-green) !important;
  border-color: var(--primary-green) !important;
  transform: none !important;
  box-shadow: 0 4px 20px rgba(183, 211, 51, 0.4),
    0 0 0 2px rgba(183, 211, 51, 0.3) !important;
}

.burger-menu-btn.active:focus-visible {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

.burger-menu-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu-content {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background: rgba(250, 248, 245, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  padding: 4rem 2rem 2rem;
  overflow-y: auto;
  transition: left 0.3s ease;
  z-index: 1001;
}

.mobile-menu-overlay.active .mobile-menu-content {
  left: 0;
}

.mobile-menu-section {
  margin-bottom: 2rem;
}

.mobile-menu-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--warm-brown);
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.mobile-menu-link {
  display: block;
  width: 100%;
  padding: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(139, 111, 71, 0.2);
  border-radius: 8px;
  transition: var(--transition-smooth);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.mobile-menu-link:hover {
  background: rgba(183, 211, 51, 0.1);
  border-color: var(--primary-green);
  transform: translateX(4px);
}

.mobile-menu-link.active {
  background: var(--primary-green);
  color: var(--text-dark);
  border-color: var(--primary-green);
  font-weight: 600;
}

.mobile-menu-link.active:hover {
  background: rgba(183, 211, 51, 0.85);
}

/* Mobile social links in menu */
.mobile-social-links {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
}

.mobile-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(139, 111, 71, 0.2);
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.mobile-social-link:hover {
  background: var(--primary-green);
  border-color: var(--primary-green);
  transform: translateY(-2px);
}

/* Action buttons (contact form links) - different style from navigation */
.mobile-menu-action {
  background: rgba(183, 211, 51, 0.2); /* Green tint - more visible */
  color: var(--text-dark);
  border: 2px solid rgba(183, 211, 51, 0.5);
  font-weight: 600;
}

.mobile-menu-action:hover {
  background: rgba(183, 211, 51, 0.35);
  border-color: var(--primary-green);
  color: var(--text-dark);
  transform: translateX(4px);
}

@media (max-width: 1024px) {
  /* Show burger menu on mobile */
  .burger-menu-btn {
    display: flex;
  }

  /* Hide desktop centered nav on mobile */
  .desktop-centered-nav {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
  }

  /* Ensure burger button matches social link size */
  .burger-menu-btn {
    width: auto;
    min-width: 48px;
    height: 48px;
    padding: 0.85rem;
  }

  .products-link,
  button.products-link,
  .about-link {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .social-link-top {
    padding: 0.6rem;
    min-width: 40px;
  }

  .social-link-top svg {
    width: 18px;
    height: 18px;
  }
}

/* Error message - shared */
.error-message {
  text-align: center;
  padding: 3rem;
  color: var(--text-gray);
  background: rgba(245, 242, 237, 0.8);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.error-message h2 {
  color: var(--warm-brown);
  margin-bottom: 1rem;
}

/* Stock status - shared */
.stock-status {
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  display: inline-block;
}

.stock-skladem {
  color: #2d5016;
  background-color: rgba(45, 80, 22, 0.1);
}

.stock-posledni-kusy {
  color: #b8860b;
  background-color: rgba(184, 134, 11, 0.1);
}

.stock-vyprodano {
  color: #8b0000;
  background-color: rgba(139, 0, 0, 0.1);
}

/* Content wrapper - shared width for product and products pages */
.product-content-wrapper,
.products-content-wrapper {
  flex: 1;
  max-width: 920px;
  width: calc(100% - 40%);
  margin: 0 auto;
  padding: 3rem 2rem;
  background: linear-gradient(
      rgba(250, 248, 245, 0.7),
      rgba(245, 242, 237, 0.7)
    ),
    url("../images/bg2.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

@media (max-width: 1400px) {
  .product-content-wrapper,
  .products-content-wrapper {
    width: calc(100% - 30%);
  }
}

@media (max-width: 1024px) {
  .product-content-wrapper,
  .products-content-wrapper {
    width: 100%;
  }
}
