/* Alap reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
main { flex: 1; }

textarea {
  resize: vertical;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* CSS változók */
:root {
  --bg: #111111;
  --text: #f5f5f5;
  --primary: #b22222;
  --secondary: #444444;
  --accent: #e63b00;
  --success: #39ed07;
}

.custom-print-container, .contact-us-container {
  width: 50%;
  padding: 1rem;
  display: flex;
  justify-content: center;
  flex-direction: column;
  margin: 0 auto;
}

/* Header */
header {
  background: var(--bg);
  padding: 20px;
  border-bottom: 1px solid var(--secondary);
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-left, .header-right {
  display: flex;
  align-items: center;
}
.header-right > *:not(:last-child) { margin-right: 1rem; }
.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
}

/* Language switcher */
.language-switcher img {
  width: 24px;
  height: 24px;
  margin-left: 10px;
  cursor: pointer;
  filter: grayscale(100%);
  transition: filter 0.3s;
}
.language-switcher img:hover { filter: grayscale(0%); }
.language-switcher select {
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--secondary);
  background-color: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

/* Cart icon és dropdown */
.cart-icon {
  position: relative;
  cursor: pointer;
}
.cart-icon img { width: 28px; }
.cart-count {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
}
.cart-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--secondary);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  min-width: 250px;
  max-width: 90vw;
  width: fit-content;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  word-wrap: break-word;
  box-sizing: border-box;
  border: 1px solid var(--primary);
}
.cart-dropdown.hidden { display: none; }
.checkout-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem;
  width: 100%;
  margin-top: 1rem;
  border-radius: 4px;
  cursor: pointer;
}

/* Product list */
#product-list {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1000px;
  margin: 2rem auto 0 auto;
  gap: 2rem;
  justify-items: center;
}

/* Popup */
.popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}
.popup.hidden { display: none; }
.popup-content {
  background: var(--bg);
  padding: 1rem 2rem 2rem 2rem;
  border-radius: 8px;
  width: calc(100% - 100px);
  color: var(--text);
  position: relative;
  overflow: scroll;
  -ms-overflow-style: none;
  scrollbar-width: none;
  border: 1px solid var(--primary);
  height: auto;
  max-height: 90%;
}
.popup-content::-webkit-scrollbar { display: none; }
.popup-close {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 2rem;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.popup-close:hover { background: #eee; }
.popup-gallery img { max-width: 100%; margin-bottom: 1rem; }

/* Add to cart */
.add-to-cart, .popup-actions .add-to-cart {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  width: 350px;
  margin-bottom: 50px;
  height: 50px;
}
.add-to-cart-index {
  padding: 6px 12px;
  background-color: #1a73e8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.add-to-cart-index:hover { background-color: #155cc0; }

/* Product card */
.product-card {
  background-color: var(--secondary);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  color: var(--text);
  transition: transform 0.2s;
  cursor: pointer;
  border: 1px solid var(--primary);
  max-width: 80%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}
.product-card:hover { transform: scale(1.02); }
.product-card img {
  width: 100%;
  height: auto;
  margin: 0 auto 1.25rem auto;
  display: block;
}
.product-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}
.product-card p {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}
.product-card button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}
.product-card button:hover { background-color: var(--accent); }

/* Gallery */

.popup-gallery {
    margin-bottom: 1rem;
    align-self: flex-start;
    position: sticky;
    top: 0;
}

.gallery-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
}
.gallery-track {
  display: flex;
  transition: transform 0.3s ease-in-out;
  width: 100%;
}
.gallery-track img, .gallery-track video {
  width: 100%; height: auto;
  max-height: 400px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}
.gallery-prev, .gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  font-size: 1.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  z-index: 2;
}
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

/* Popup details */
.popup-details {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
}
.popup-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    flex-direction: column;
}
.popup-header h1 {
  font-size: 1.8rem;
  margin: 0;
}
.popup-body .popup-price {
  font-weight: bold;
  color: var(--text);
  font-size: 40px;
}
.popup-body {
 display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.popup-description {
  flex: 1 1 65%;
  font-size: 1rem;
  line-height: 1.6;
}
.popup-actions {
  display: flex;
    height: 100%;
    align-items: flex-end;
}

/* Cart controls (összevonva) */
.cart-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px;
}
.cart-controls button {
  width: 24px;
  height: 24px;
  font-weight: bold;
  border: none;
  background-color: #ddd;
  cursor: pointer;
  border-radius: 4px;
}

/* Cart line */
.cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.cart-line strong {
    width: calc(100% / 3);
}

/* Order oldal kosár ikon eltüntetése */
body.order-page .cart-icon { display: none !important; }

/* Loader */
.loader {
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid var(--primary);
  width: 120px; height: 120px;
  animation: spin 2s linear infinite;
  margin: 50px auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Footer */
footer {
  background: var(--bg);
  padding: 20px;
  border-top: 1px solid var(--secondary);
  margin-top: 3rem;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  color: var(--text);
}
.footer-logo {
  font-weight: bold;
  font-size: 1.2rem;
}

/* Card footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 0 10px;
}
.product-price {
  margin: 0;
  font-weight: bold;
}

/* Order oldal, modal */
.order-container { width: 50%; margin: 0 auto; }
main h1, main h2 { margin-bottom: 1rem; color: var(--text); }
.order-form h2 { margin-top: 40px; }
.modal {
  position: fixed;
  top: 5%; left: 50%;
  transform: translateX(-50%);
  background-color: var(--success);
  color: var(--text);
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.modal.show {
    opacity: 1;
}
.hidden {
    display: none;
}
.modal.success {
  background-color: var(--success);
}
.modal.error {
  background-color: var(--primary);
}

/* Formok */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}
form label { font-weight: 600; color: var(--text); }
form input, form textarea, form select {
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--secondary);
  background-color: #1a1a1a;
  color: var(--text);
  font-size: 1rem;
}
form input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}
form a {
  color: var(--primary);
  text-decoration: underline;
}

/* Kosár áttekintő */
#cart-review {
  background-color: var(--secondary);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}
#cart-items-summary p { margin-bottom: 0.5rem; }

/* Privacy szöveg */
.html_privacy_text p:not(:has(b)) {
  margin-left: 10px;
}

/* Select2 sötét stílus - csak az egyszer írt, nem duplikált sorok */
.select2-container--default .select2-selection--single {
  background-color: #1a1a1a !important;
  color: var(--text) !important;
  border: 1px solid var(--secondary);
  border-radius: 4px;
  min-height: 42px;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text);
  line-height: 1.6;
  padding-left: 2px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  top: 0;
  right: 10px;
}
.select2-container--default .select2-selection--single:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary);
}
.select2-container--default .select2-results__option {
  padding: 10px;
  font-size: 0.95rem;
  color: var(--text) !important;
  background-color: #1a1a1a !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary) !important;
  color: white !important;
}
.select2-selection__rendered::before { content: none !important; }
.select2-container {
  width: 100% !important;
  margin-top: 10px;
}
.select2-dropdown {
  background-color: #1a1a1a !important;
  border: 1px solid var(--secondary);
  color: var(--text);
  z-index: 9999;
}
.select2-results, .select2-results__option {
  background-color: #1a1a1a !important;
  color: var(--text) !important;
}
.select2-search--dropdown .select2-search__field {
  background-color: #1a1a1a !important;
  color: var(--text) !important;
  border: 1px solid var(--secondary) !important;
  padding: 6px 10px;
  font-size: 1rem;
}
@media (min-width: 700px) {
  #product-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .container,
  .order-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0.5rem !important;
  }
  .header-content,
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    display: flex;
    flex-direction: row;
  }
  .logo {
    font-size: 1.1rem;
  }
  .product-card {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.95rem;
  }
  .popup-content {
    width: 97vw !important;
    min-width: unset;
    padding: 1rem 0.5rem 1rem 0.5rem;
    align-items: start;
  }
  .add-to-cart, 
  .popup-actions .add-to-cart {
    width: 100%;
    min-width: unset;
    margin: 2rem auto 0 auto;
    padding: 0.7rem 0.5rem;
    font-size: 1rem;
  }
  .product-card img,
  .gallery-track img,
  .gallery-track video {
    max-width: 100vw;
    max-height: 40vw;
  }
  #product-list {
    gap: 1rem;
    margin: 1rem 0 0 0;
    padding: 20px !important;
  }
  .modal {
    width: 95vw;
    left: 2.5vw;
    transform: none;
    padding: 1rem;
  }
  main h1, main h2 {
    font-size: 1.3rem;
  }
  .select2-container--default .select2-selection--single {
    font-size: 0.9rem;
    padding: 4px 10px;
  }
.cart-dropdown {
    position: fixed;
    top: 70px;
    left: 5%;
    right: 5%;
    width: 90%;
    max-width: 90%;
    border-radius: 8px;
    padding: 1rem;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
  }
  .card-footer {
    gap: 6px;
    padding: 0;
    display: flex;
    flex-direction: row;
  }
  
  .popup-details {
          flex-direction: column !important;
  }
  
  .custom-print-container, .contact-us-container{
    width: 100%;
    margin: 0;
  }
  
  .cart-dropdown {
    position: fixed;
    top: 70px;
    left: 5%;
    right: 5%;
    width: 90%;
    max-width: 90%;
    border-radius: 8px;
    padding: 1rem;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
  }
}

.contact-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid var(--secondary);
  padding: 6px 10px;
  border-radius: 4px;
  transition: 0.2s;
  margin-right: 20px;
}

.contact-link:hover {
  background-color: var(--primary);
  color: white;
}

.lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.lightbox.hidden {
  display: none;
}
.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
}

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

.header-left .logo img {
    width: 190px;
    height: auto;
    display: block;
}


/* Product modal – gallery always aligned to top */

.popup-content {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: start;
    gap: 32px;
}

.popup-gallery {
    position: static;
    align-self: start;
    margin: 0;
    min-width: 0;
}

.gallery-wrapper {
    width: 100%;
    margin: 0;
}

.popup-details {
    min-width: 0;
    align-self: start;
}

/* Mobile layout */
@media (max-width: 768px) {
    .popup-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}