/* ==========================================================================
   1. PREMENNÉ A GLOBÁLNE ŠTÝLY
   ========================================================================== */
:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-heading: #0f172a;
    --text-body: #475569;
    --primary: #1e40af;
    --primary-hover: #1e3a8a;
    --border: #e2e8f0;
    --secondary: #0369a1;
    --secondary-hover: #0369a1;
    --text-secondary-btn: #ffffff;
    --radius-input: 10px;
    --radius-card: 10px;
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 10px 15px -3px rgba(15, 23, 42, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.5;
}

h2 {
    color: var(--secondary);
}

p {
    margin: 8px 0;
}

h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 8px;
    font-weight: 600;
}


/* Pomocná trieda pre skryté elementy - zlúčená duplicita */
.hidden {
    display: none !important;
}

/* ==========================================================================
   2. STRUKTÚRA A LAYOUT (STRÁNKA / SEKCIE)
   ========================================================================== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.preview {
    max-width: 1155px;    
    margin: 0 auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background-color: var(--bg-main);
}

header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-section {
  text-align: center;
  padding: 40px 20px 24px 20px;
  max-width: 800px;
  margin: 0 auto;
}

.hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #4a5568; /* Príjemná tmavosivá, ktorá netrhá oči */
  max-width: 650px;
  margin: 0 auto;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary); /* Aleby tvoja korporátna tmavomodrá z názvu firmy */
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-self: start;
}

.preview-section {
    padding: 20px 0;
    background-color: #ffffff;
}

.preview-header {
    margin-bottom: 20px;
}

footer {
    text-align: center;
    background-color: var(--primary);
    color: #94a3b8;
    padding: 20px 0;
    font-size: 0.9rem;
    border-top: 1px solid #1e293b;
}

/* ==========================================================================
   3. KOMPONENTY (NAVIGÁCIA, KARTY, DROPDOWN, LOADING)
   ========================================================================== */
/* Logo & Navigácia */
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--primary);
}

nav ul {
    display: flex;
    gap: 24px;
    list-style: none;
}

nav a {
    text-decoration: none;
    color: var(--text-body);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--text-heading);
}

/* Hero text */
.hero-text h1 {
    margin: 16px 0;
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-body);
    margin-bottom: 24px;
}

/* Karty (Form, Info, Main) */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 32px;
    box-shadow: var(--shadow);
}

.info-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background-color: var(--bg-main);
}

.info-card h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-body);
}

.main-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.dynamic-content {
    flex-grow: 1;
}

/* Vyhľadávací Dropdown */
#search-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.results-dropdown {
    position: absolute;
    left: 0;
    margin-top: 8px;
    z-index: 1000;
    width: inherit;
}

.results-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow: auto;
}

.result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover,
.result-item:focus {
    background: #f4f6f8;
    outline: none;
}

/* Pricing mriežka */
.pricing-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
}

.pricing-item {
    flex: 1;
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    position: relative;
    transition: all 0.2s;
}

/* Status lem */
.status-lem {
    height: 0;
    border-top: 1px solid #f0f0f0;
    display: flex;
    z-index: 10;
    margin-bottom: -44px;
    justify-content: center;
    align-items: center;
}

.status-text {
    margin: 0;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    width: inherit;
}

/* Modálne okno */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2000;
}

.modal-content {
    background: #fff;
    padding: 20px;
    width: 100vw;
    height: 100vh;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: auto;
}

.modal-content .close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

/*
.modal-content button {
    width: auto;
    padding: 10px 16px;
    margin: 15px auto 0;
}
*/
/* Loading obrazovka & Spinner */
#loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e0e0e0;
    border-top: 6px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    color: #333;
    text-align: center;
    line-height: 1.5;
}

.loading-text span {
    font-weight: bold;
    color: var(--primary);
}

/* Image Gallery */
.image-gallery {
    margin: 2rem auto 0;
    width: 100%;
    padding: 0 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;            
    max-width: 900px;
    margin: 2rem auto;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    object-fit: cover;
    display: block;
}

/* Textové zoznamy */
.text-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.text-list li {
    margin-bottom: 0.5rem;
}

.text-list li::marker {
    color: var(--primary);
    font-size: 1.1em;
}

/* ==========================================================================
   4. FORMULÁRE, INPUTY A TLAČIDLÁ
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 8px;
}

#output, input, textarea, select {
    width: 100%;
    box-sizing: border-box;
}

input, textarea, select {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 0.95rem;
    color: var(--text-heading);
    background-color: #ffffff;
    transition: all 0.2s;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

input::placeholder, textarea::placeholder {
    color: #94a3b8;
}

/* Spoločné štýly pre tlačidlá */
.btn-submit, .btn-continue {
    width: inherit;
    padding: 14px;
    border: none;
    border-radius: var(--radius-input);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    transition: background-color 0.2s;
}

.btn-submit {
    background-color: var(--primary);
    margin-top: auto;
}
.btn-submit:hover { background-color: var(--primary-hover); }

.btn-continue { background-color: var(--secondary); }
.btn-continue:hover { background-color: var(--secondary-hover); }

/* Produktová mriežka / Výber */
.product-selection-container {
    font-family: sans-serif;
    max-width: 800px;
    margin: 20px 0;
}

.product-title {
    display: block;
    font-weight: bold;
    margin-bottom: 12px;
}

.product-grid, .preview-grid {
    display: grid;
    gap: 24px;
}

.preview-grid { grid-template-columns: repeat(4, 1fr); }
.product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

.product-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
}

.product-card input[type="radio"] {
    display: none;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

.card-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #1a202c;
}

.card-desc {
    font-size: 0.85rem;
    color: #718096;
}

.card-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2b6cb0;
    margin-top: 5px;
}

.product-card:has(input[type="radio"]:checked) {
    border-color: #3182ce;
    background-color: #ebf8ff;
    box-shadow: 0 4px 6px -1px rgba(49, 130, 206, 0.2);
}

/* Formulárový fix pre výšku */
.form_div {
    height: 500px;
    min-height: 500px;
    max-height: 500px;
    overflow: hidden;
}

/* ==========================================================================
   5. RESPONZÍVNY DIZAJN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .hero-text {
        text-align: center;
    }
}

@media (max-width: 600px) {
    /* Zlúčené štýly pre šírku pod 600px */
    .preview-grid, .product-grid {
        grid-template-columns: 1fr;
    }
    nav {
        display: none;
    }
    .hero-text h1 {
        font-size: 2rem;
    }
    .form-card {
        padding: 20px;
    }
    .form_div {
        height: 650px;
        min-height: 650px;
        max-height: 650px;
    }
}

@media (max-width: 540px) {
    .image-gallery {
        padding: 0 0.75rem;
    }
}

/* tabulka dokladov */
table {
  width: 100%;                 /* Roztiahnutie na celú šírku */
  border-collapse: collapse;   /* Zruší škaredé dvojité čiary medzi bunkami */
  margin: 20px 0;              /* Odsadenie tabuľky od okolitého textu */
  font-size: 0.9em;            /* Mierne menšie písmo pôsobí v tabuľkách elegantnejšie */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05); /* Veľmi jemný tieň pre moderný vzhľad */
}

th, td {
  padding: 12px 15px;          /* Dostatočný priestor pre text, aby to "dýchalo" */
  text-align: left;            /* Zarovnanie textu doľava (štandard pre moderný web) */
}

th:first-child, td:first-child {
  width: 30%; 
}

thead tr {
  /* Tu sa ti aplikuje tvoja farba pozadia pre hlavičku z existujúceho CSS */
  font-weight: bold;           /* Zvýraznenie textu v hlavičke */
}

tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* Jemná deliaca čiara medzi riadkami */
}

/* Voliteľné: Striedanie farieb riadkov (tzv. zebra efekt) pre lepšiu čitateľnosť */
tbody tr:nth-of-type(even) {
  background-color: rgba(0, 0, 0, 0.02); /* Využíva jemnú priesvitnú čiernu, takže sa prispôsobí tvojmu pozadiu */
}

/* Voliteľné: Zvýraznenie riadku, nad ktorým je myš */
tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.04); 
}

td a {
    text-decoration: none;
    font-weight: bold;
    color: var(--secondary);
}