/* Dodavanje stila za odabrani redak tablice */
.main-table tbody tr.selected {
  background-color: #ffcccc !important;
  color: #c00;
  font-weight: bold;
}

/* Gumb za košaricu */
.cart-button {
  background-color: #cc0000;
  color: #fff;
  font-size: 16px;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 20px 0;
}

.cart-button:hover {
  background-color: #a30000;
}

/* Stranica košarice */
.cart-page {
  font-family: Verdana, Arial, Helvetica;
  width: 100%; /* Tablica košarice sada zauzima 100% širine roditeljskog elementa */
  max-width: 600px; /* Ograničena širina na 600px */
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box; /* Uključuje padding u ukupnu širinu elementa */
}

.cart-page h2 {
  color: #cc0000;
}

.cart-table {
  width: 100%; /* Tablica koristi punu širinu roditeljskog elementa */
  max-width: 600px; /* Ograničena širina na 600px */
  border-collapse: collapse;
  margin-top: 20px;
  table-layout: auto; /* Automatsko raspoređivanje širina */
  word-wrap: break-word; /* Omogućava prelamanje teksta unutar ćelija */
  box-sizing: border-box; /* Uključuje padding u ukupnu širinu elementa */
}

.cart-table th, .cart-table td {
  border: 1px solid #ccc;
  padding: 5px;
  text-align: center; /* Centrirani tekst u ćelijama */
  box-sizing: border-box; /* Uključuje padding u ukupnu širinu ćelija */
}

.cart-table th {
  background-color: #cc0000;
  color: #fff;
  text-transform: uppercase; /* Velika slova u zaglavlju */
}

.cart-table td input {
  width: 60px;
}

.total-amount {
  font-size: 16px;
  font-weight: bold;
  margin-top: 20px;
}

/* Pokazivač ruke na redove tablice */
.main-table tbody tr {
  cursor: pointer;
}

.cart-table th:nth-child(1), .cart-table td:nth-child(1) {
  width: 46%; /* ARTIKL - 40% širine */
}

.cart-table th:nth-child(2), .cart-table td:nth-child(2) {
  width: 16%; /* Ostale dvije kolumne po 18% širine */
}

.cart-table th:nth-child(3), .cart-table td:nth-child(3) {
  width: 20%; /* KOLIČINA - 20% širine */
}

.cart-table th:nth-child(4), .cart-table td:nth-child(4) {
  width: 18%; /* Ostale dvije kolumne po 18% širine */
}

/* Dodavanje Box-sizing za sve elemente, kako bi padding bio uključен u širinu */
* {
  box-sizing: border-box;
}

/* Uklanjanje margina na roditeljskim elementima (ako postoje) */
body, .cart-page, .cart-container {
  margin: 0;
  padding: 0;
}

/* Uklanjanje strelica u WebKit preglednicima (Chrome, Safari, Edge) */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Uklanjanje strelica u Firefoxu */
.quantity-input[type=number] {
  -moz-appearance: textfield;
}

/* Stilovi za kvadratić za količinu */
.quantity-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.quantity-btn {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ccc;
  background-color: #f8f8f8;
  cursor: pointer;
  font-size: 20px;
  font-weight: normal;
}

@media (max-width: 600px) {
  .quantity-btn {
    display: none;
  }
  .cart-table td input {
  width: 50px;
  }
  .cart-table th:nth-child(1), .cart-table td:nth-child(1) {
  width: 51%; /* ARTIKL - 51% širine */
  }
  .cart-table th:nth-child(3), .cart-table td:nth-child(3) {
  width: 13%; /* KOLIČINA 13% širine */
  }
}

.quantity-input {
  height: 25px;
  text-align: center;
  border: 1px solid #ccc;
  font-size: 16px;
}

/* Gumbi za navigaciju */
#scroll-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    z-index: 1000;
    display: flex; /* Ostavlja element u layoutu */
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    
    opacity: 0; /* Početno nevidljiv */
    visibility: hidden; /* Sprječava interakciju dok je sakriven */
    transform: translateY(40px); /* Lagano spušten da izbjegnemo trzanje */
    transition: opacity 1s ease, transform 1s ease, visibility 0s 1s;
}

/* Prikazivanje gumba */
#scroll-buttons.show {
    opacity: 0.9;
    visibility: visible;
    transform: translateY(0); /* Pomaknut na početni položaj */
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s;
}

#scroll-buttons a {
    margin: 0 12px;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

#scroll-buttons img {
    width: 50px; /* Prilagodba veličine ikonica prema potrebi */
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #CC0000;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}
