:root {
    --textColor: rgb(0, 0, 0);
    --hoverColorText: rgb(100, 100, 100);
    --hoverColorBtn: rgb(0, 110, 228);
    --btnColor: rgb(0, 123, 255);
    --cardText: rgb(0, 0, 0);
    --cardColor1: rgb(255, 255, 255);
    --whiteText: rgb(255, 255, 255);
    --checked: rgb(103, 201, 247);
}

body {
    background-color: rgb(243, 243, 243);
    margin-left: 0px;
}


/* filter */

#filter {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-right: 0;
    width: 100%;
    max-width: 250px;
}

@media (max-width: 768px) {
    #filter {
        max-width: 90%;
        margin: auto;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    #filter {
        padding: 15px;
    }
}

.filterKarta {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.filterKarta h3 {
    margin-bottom: 10px;
    color: var(--textColor);
}

.filterKarta input[type="checkbox"] {
    margin-right: 8px;
}

.filterKarta label {
    cursor: pointer;
    display: inline-block;
    margin-bottom: 8px;
}

#cenaFilter {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

#cenaFilter div {
    display: flex;
    align-items: center;
}

.cenaOdDo {
    width: 30px;
    margin-right: 10px;
}

#cenaFilter input {
    width: 100px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#filtrovatBtn {
    background-color: var(--btnColor);
    color: var(--whiteText);
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    margin-top: 10px;
}

#filtrovatBtn:hover {
    background-color: var(--hoverColorBtn);
}

#resetFiltreBtn {
    background: red;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.08);
    letter-spacing: 0.5px;
}

#resetFiltreBtn:hover {
    background: linear-gradient(90deg, #c0392b 70%, #ff7675 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.13);
}

/* Ak chceš, aby tlačidlá boli vedľa seba na desktopoch: */
#filtrovatBtn, #resetFiltreBtn {
    width: 48%;
    display: inline-block;
    margin-right: 2%;
    padding: 12px 0;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    height: 48px;
    vertical-align: middle;
    line-height: 1.2;
}

#filtrovatBtn {
    background-color: var(--btnColor);
    color: var(--whiteText);
    box-shadow: 0 2px 8px rgba(0,123,255,0.08);
    margin-top: 10px;
    margin-bottom: 5px;
}

#filtrovatBtn:hover {
    background-color: var(--hoverColorBtn);
    color: var(--whiteText);
    box-shadow: 0 4px 16px rgba(0,123,255,0.13);
}

#resetFiltreBtn {
    background-color: #e74c3c;
    color: var(--whiteText);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.08);
    margin-top: 10px;
    margin-bottom: 5px;
    margin-right: 0;
}

#resetFiltreBtn:hover {
    background-color: #c0392b;
    color: var(--whiteText);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.13);
}

.category-item {
    margin-bottom: 6px;
}

.category-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.category-header:hover {
    color: var(--hoverColorText);
}

.category-header input[type="checkbox"] {
    margin-right: 6px;
}

.category-header label {
    margin-left: 6px;
    font-weight: 600;
}

/* šípka */
.arrow {
    font-size: 0.8rem;
    width: 14px;
    display: inline-block;
    color: var(--hoverColorText);
    transition: transform 0.2s ease;
}

/* podkategórie */
.subcategory {
    display: none;
    margin-left: 24px;
    margin-top: 4px;
    padding-left: 6px;
    border-left: 2px solid rgba(0, 0, 0, 0.05);
}

.sub-item {
    margin: 4px 0;
}

.sub-item label {
    font-weight: normal;
    font-size: 0.95rem;
    color: var(--textColor);
}

/* hover efekt na podkategórie */
.sub-item:hover label {
    color: var(--hoverColorText);
}

/* Na mobiloch pod seba */
@media (max-width: 600px) {
    #filtrovatBtn, #resetFiltreBtn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
        display: block;
        height: 48px;
    }
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    appearance: none;
    border: 2px solid var(--btnColor);
    vertical-align: middle;
    margin-top: 0;
    transition: 200ms;
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background-color: var(--hoverColorBtn);
    border: none;
}

label {
    vertical-align: middle;
    margin-left: 10px;
    cursor: pointer;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}


/*produkty*/

#flexDiv {
    display: flex;
    flex-direction: row;
    margin: 30px;
    gap: 30px;
}

#produkty {
    flex-grow: 1;
    display: grid;
    /* Zmenšený minmax, aby sa karty lepšie prispôsobili */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 20px;
    padding-top: 10px;
    margin-bottom: 100px;
    align-content: start;
}

.popularCard {
    background-color: var(--cardColor1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    color: var(--cardText);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: auto;
}

.popularCard:hover {
    transform: translateY(-5px); /* Karta sa pri hoveri jemne nadvihne */
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.ImgContainer {
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--cardColor1); /* Jemné pozadie pod obrázkom */
    overflow: hidden;
    padding: 10px;
}

.popularImg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* PRODUKT BUDE VŽDY CELÝ A NEBUDE OREZANÝ */
    transition: transform 0.3s ease;
}

.popularCard:hover .popularImg {
    transform: scale(1.08); /* Jemný zoom obrázka */
}

.popularText {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.popularNadpis {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--textColor);
    font-weight: 700;
    line-height: 1.2;
}

.popularPopis {
    font-size: 0.85rem;
    color: var(--hoverColorText);
    margin-bottom: 15px;
    line-height: 1.5;
    /* Obmedzenie na 2 riadky */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stockStatus {
    font-weight: 600;
    font-size: 0.8rem;
    margin-top: auto; 
    margin-bottom: 10px;
}

#popularKupitCena {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    margin: 5px 10px;
}

.popularCena {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--btnColor);
}

.popularKupit {
    background-color: var(--btnColor);
    color: var(--whiteText);
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.popularKupit:hover:not(:disabled) {
    background-color: var(--hoverColorBtn);
    color: var(--whiteText);
}

.popularKupit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.pridatCart {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.popularCena {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--textColor);
    white-space: nowrap;
}

/* ak nie su produkty */
#produkty:empty::before {
    content: "Žiadne produkty na zobrazenie.";
    color: var(--hoverColorText);
    font-style: italic;
}

@media (min-width: 1024px) {
    #produkty {
        grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    }
}

@media (max-width: 768px) {
    #flexDiv {
        flex-direction: column;
        margin-right: 0;
        margin-left: 0;
    }
    
    #produkty {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}




/*vyhladavanie*/

.search-container {
    position: relative;
    max-width: 400px;
    margin: 20px auto;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--btnColor);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cardColor1);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 10;
    margin-top: 5px;
}

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #dee2e6;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #f4f7f6;
}

.suggestion-item:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
        padding: 10px;
    }
    
    #flexDiv {
        flex-direction: column;
        margin-right: 20px;
        margin-left: 20px;
        margin-bottom: 20px;
    }
}

.notification-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.notification-overlay.active {
  opacity: 1;
  visibility: visible;
}

.notification-box {
  background-color: var(--cardColor1);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.notification-overlay.active .notification-box {
  transform: translateY(0);
}

.notification-content {
  padding: 2rem;
  text-align: center;
  color: var(--cardText);
}

.notification-icon {
  display: inline-block;
  width: 60px;
  height: 60px;
  background-color: var(--checked);
  color: var(--whiteText);
  border-radius: 50%;
  font-size: 2rem;
  line-height: 60px;
  margin-bottom: 1rem;
}

.notification-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.notification-message {
  margin: 0;
  line-height: 1.5;
}

.notification-close-btn {
  width: 100%;
  padding: 1rem;
  background-color: var(--btnColor);
  color: var(--whiteText);
  border: none;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.notification-close-btn:hover {
  background-color: var(--hoverColorBtn);
}

/* Notifikačné typy */
.notification-box.notification-success .notification-icon {
  background-color: #27ae60;
}

.notification-box.notification-error .notification-icon {
  background-color: #e74c3c;
}

.notification-box.notification-warning .notification-icon {
  background-color: #f39c12;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cardColor1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 10;
}

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: var(--bgColor);
}

.suggestion-item:last-child {
    border-bottom: none;
}