/*
 Theme Name:   C&D
 Description:  C&D Child tema za Divi
 Author:       Teo Đurković
 Template:     Divi
 Version:      1.0.0
*/

/* Sekcija za upsell i cross-sell */
.custom-upsell-products {
    padding: 20px;
    margin-top: 20px;
}
.custom-upsell-products h3 {
    color: #333333;
    font-size: 20px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: left;
}
.upsell-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
}
.upsell-product {
    text-align: center; /* Centrirana slika */
    padding: 10px; /* Mali padding sa svih strana */
    border: 1px solid #F5F5F5; /* Box oko kartice */
    border-radius: 4px; /* Blagi zaobljeni rubovi boxa */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, background-color 0.3s ease-in-out; /* Finiji prijelaz */
}
.upsell-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #F9F9F9; /* Svijetla pozadina na hover */
}
.upsell-product img {
    max-width: 100%;
    height: 180px; /* Tvoja promjena visine slike */
    object-fit: cover;
    margin-bottom: 10px;
}
.upsell-product .btn {
    background: #e02b20; /* Standardna boja */
    color: #FFFFFF;
    font-size: 15px; /* Veličina teksta po zahtjevu */
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    padding: 10px 12px; /* Manji padding za mali gumb */
    border-radius: 999px; /* Maksimalni zaobljeni rubovi */
    text-decoration: none;
    display: block; /* Novi red */
    margin-left: 0; /* Lijevo poravnanje */
    margin-bottom: 5px;
    line-height: 1; /* Kompaktni izgled s ikonom */
    width: fit-content; /* Širok koliko teksta ima */
    transition: all 0.3s ease-in-out; /* Finiji prijelaz za gumb */
}
.upsell-product .btn:hover {
    background: #ad1b1b; /* Boja na hover */
}
.upsell-product .btn i {
    margin-right: 3px; /* Manji razmak između ikone i teksta */
    font-size: 15px; /* Manja ikona */
}
.upsell-product .price {
    color: #e02b20;
    font-size: 22px !important;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
    text-align: left; /* Lijevo poravnanje cijene */
}
.upsell-product .price del {
    color: #777777;
    font-weight: normal;
    margin-left: 5px;
}
.upsell-product .save {
    color: #666666;
    font-size: 12px;
    display: block;
    margin-bottom: 5px;
    text-align: left; /* Lijevo poravnanje uštede */
}
.upsell-product h4 {
    color: #333333;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    min-height: 40px; /* Osigurava konzistentnu visinu za tekst */
    text-align: left; /* Lijevo poravnanje opisa */
}

/* Responzivnost */
@media (max-width: 980px) {
    .upsell-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 767px) {
    .upsell-grid {
        grid-template-columns: 1fr;
    }
    .upsell-product img {
        height: 170px; /* Prilagođena visina za mobitele */
    }
    .upsell-product h4 {
        min-height: 30px;
    }
}

/* WOOCOMMERCE GALLERY NA STRANICI PROIZVODA */
.woocommerce-product-gallery .flex-control-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important; /* Osigurava prikaz u jednom redu */
    gap: 8px !important; /* Manji razmak između slika */
    overflow-x: auto !important; /* Omogućava horizontalni scroll ako ih ima više */
    padding-bottom: 10px !important; /* Prostor za scroll bar */
}
.woocommerce-product-gallery .flex-control-thumbs li {
    flex: 0 0 70px !important; /* Fiksna širina za svaku sliku */
    width: 70px !important;
    height: 70px !important;
    margin: 0 !important; /* Uklanja default margine */
}
.woocommerce-product-gallery .flex-control-thumbs li img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Osigurava da slika ispuni prostor */
    border-radius: 4px;
    border: 1px solid #F5F5F5;
}
.woocommerce-product-gallery .flex-control-thumbs li img:hover,
.woocommerce-product-gallery .flex-control-thumbs li img.flex-active {
    border-color: #e34b4b;
    box-shadow: 0 0 5px rgba(227, 75, 75, 0.3);
}

/* Skrivenje scrollbara za ljepši izgled */
.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar {
    height: 4px;
}
.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-thumb {
    background: #e34b4b;
    border-radius: 4px;
}
.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-track {
    background: #F5F5F5;
}

/* Responzivnost */
@media (max-width: 767px) {
    .woocommerce-product-gallery .flex-control-thumbs li {
        flex: 0 0 60px !important;
        width: 60px !important;
        height: 60px !important;
    }
    .woocommerce-product-gallery .flex-control-thumbs {
        gap: 6px !important;
    }
}

.cid-proizvod-menu-item{
    margin-bottom:20px;
}

/*Toggle*/
.custom-toggle {
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}

.custom-toggle-button {
  width: 100%;
  background: #f7f7f7;
  border: none;
  padding: 12px 16px;
  text-align: left;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.custom-toggle-button:hover {
  background: #e2e2e2;
}

.custom-toggle-content {
  display: none;
  padding: 15px;
  background: #fff;
}

.custom-toggle-content.active {
  display: block;
}

/*========================[PRODUCT CARD LOOP DP]==============================*/
.cp-proizvod {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    background: #fff;
    transition: transform 0.2s ease;
}
.cp-proizvod:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.cp-slika img {
    width: 100%;
    height: auto;
    display: block;
}
.cp-title {
    color: #333333;
    font-size: 20px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    margin-top:10px;
    margin-left: 10px;
    margin-right: 10px;
    line-height: 1.2;
	height: 50px;
    max-height: 50px;
	overflow: hidden;
    text-align: left;
}
.cp-title a {
    text-decoration: none;
}
.cp-cijena {
    color: #e02b20;
    font-size: 22px !important;
    font-weight: bold;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 5px;
    display: block;
    text-align: left;
}
.cp-ajax-add-to-cartt {
    margin-top: 10px;
}
.cp-ajax-add-to-cart {
     background: #e02b20; /* Standardna boja */
    color: #FFFFFF !important;
    font-size: 15px; /* Veličina teksta po zahtjevu */
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    padding: 10px 12px; /* Manji padding za mali gumb */
    border-radius: 999px; /* Maksimalni zaobljeni rubovi */
    text-decoration: none;
    display: block; /* Novi red */
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 10px;
    line-height: 1; /* Kompaktni izgled s ikonom */
    width: fit-content; /* Širok koliko teksta ima */
    transition: all 0.3s ease-in-out; /* Finiji prijelaz za gumb */
}
.cp-ajax-add-to-cart:hover {
    background: #b00;
}
.cp-rating {
    margin: 6px 0;
}
.cp-out-of-stock-label {
    background: #da171f;
    color: #fff;
    padding: 11px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
}
.swiper-wrapper{
    padding-top:5px !important;
}

/*=====================[KRAJ PORDUCT CART LOOP DP]============================*/
/* =======================[MOBILE OVERRIDE]======================= */
@media (max-width: 768px) {
  .support-button {
      float: none !important;
      margin-left: auto;
      margin-right: auto;
  }
  .cp-proizvod {
    border-radius: 8px;
    /* na mobitelu nema "skakanja" na hover */
    transition: none;
  }
  .cp-proizvod:hover {
    transform: none;
    box-shadow: none;
  }

  .cp-title {
    font-size: 16px;         /* manji naslov */
    margin: 8px 8px 0 8px;   /* malo uži margini */
    line-height: 1.25;
    height: 35px;            /* niži box da stane u karticu */
    max-height: 42px;
  }

  .cp-cijena {
    font-size: 18px !important;  /* manja cijena */
    margin: 6px 8px 4px 8px;
  }

  .cp-ajax-add-to-cart {
    font-size: 14px;         /* manji font gumba */
    padding: 9px 12px;       /* kompaktniji padding */
    margin: 6px 8px 10px 8px;
  }

  .cp-rating {
    margin: 4px 0;
    transform: scale(0.95);  /* blago smanji zvjezdice ako ih ima */
    transform-origin: left center;
  }

  .cp-out-of-stock-label {
    padding: 9px 8px;
    font-size: 14px;
    border-radius: 4px;
  }

  /* Ako ti slike znaju biti previsoke, možeš ograničiti visinu */
  .cp-slika img {
    height: auto;
    max-height: 220px;       /* po potrebi promijeni/ukloni */
    object-fit: contain;
  }

  /* slider unutarnji padding malo manji na mobu */
  .swiper-wrapper {
    padding-top: 4px !important;
  }
}

/* još malo “tješnje” za vrlo male ekrane */
@media (max-width: 480px) {
  .cp-title {
    font-size: 16px;
    height: 35px;
  }
  .cp-cijena {
    font-size: 18px !important;
  }
  .cp-ajax-add-to-cart {
      white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
    font-size: 8px;
    padding: 8px 8px;
  }
}

.yith-wfbt-submit-button.button {
    transform: scale(0.75);
    transform-origin: left;
}
/* Cijena u YITH Frequently Bought Together */
.yith-wfbt-submit-block .total_price {
        display: block;
    color: #ad1b1b;
    font-size: 30px;
    font-weight: 700;
    margin-top: 10px;
    margin-bottom: 10px;
}
.yith-wfbt-item .price .woocommerce-Price-amount.amount {
    color: #ad1b1b;
    font-weight: 700;
}
/* MASONRY NA NASLOVNICI */
.masonry-wrapper {
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px;
}

.masonry-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
}

.grid-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.grid-col.small-col {
  flex: 1;
}

.grid-col.large-col {
  flex: 2;
}

.grid-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1; /* kvadrat */
  overflow: hidden;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.grid-item.large {
  aspect-ratio: 1/1.0278; /* visina = 2 kvadrata */
}

/* Skrivanje poruke o ažuriranju opcija dostave */
.woocommerce-shipping-destination {
    display: none !important;
}

/* Skrivanje linka za izračun dostave */
.shipping-calculator-button {
    display: none !important;
}

/*Custom tabs CSS*/
.custom-tabs-wrapper {
    max-width: 100%;
    /*border-bottom: 1px solid #e0e0e0;*/
    margin-bottom: 20px;
}

.custom-tabs-nav {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid #ddd;
    justify-content: flex-start;
    align-items: center;
}

.custom-tab-btn {
    background: none;
    border: none;
    padding: 12px 0;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    color: #111;
    position: relative;
    transition: color 0.2s ease;
}

.custom-tab-btn:hover {
    color: #ad1b1b;
}

.custom-tab-btn::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ad1b1b;
    transition: width 0.25s ease;
}

.custom-tab-btn:hover::after {
    width: 100%;
}

.custom-tab-btn.active {
    color: #ad1b1b;
}

.custom-tab-btn.active::after {
    width: 100%;
}

.custom-tabs-content {
    margin-top: 25px;
}

.custom-tab-content {
    display: none;
}

.custom-tab-content.active {
    display: block;
}


/* Sticky efekt unutar parent sekcije */
.et_pb_specialty_column.et-last-child {
    position: sticky;
    top: 50px; /* udaljenost od vrha ekrana dok skrolaš */
    align-self: start;
}

/* Ograniči da sticky ostaje unutar parent sekcije */
.et_pb_section {
    position: relative;
    overflow: visible;
}

/* Spriječi prelazak rowova van okvira */
.et_pb_specialty_column.et-last-child > .et_pb_row {
    margin-bottom: 20px;
}
.yith-wcan-filter{
    border-bottom: #ddd 1px solid;
    
}
.filter-title{
    font-weight:bold;
}

/* obavezno: label se pozicionira unutar slike, ne na kraju reda */
.cp-slika-wrapper, .cp-slika { position: relative; }

/* pokušaj pokriti najčešće klase pluginova za labele */
/* (ako znaš tačnu klasu tvog plugina, dodaj je ovdje) */
.cp-slika-wrapper .awpl-label,
.cp-slika-wrapper .wc-label,
.cp-slika-wrapper .product-label,
.cp-slika-wrapper .wcapl-label,
.cp-slika-wrapper .apl-label,
.cp-slika-wrapper .advanced-product-label {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  pointer-events: none; /* da ne hvata hover iznad gumba itd. */
}
/* Mobitel: 2 reda po 3 elementa za .et_pb_row_6col */
@media (max-width: 767px) {
  .et_pb_row_6col {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 12px; /* po želji: razmak među ćelijama */
  }

  /* reset Divi mobilnih stilova na kolumnama */
  .et_pb_row_6col > .et_pb_column {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Mobilni prikaz */
/*@media (max-width: 991.98px) {
  .cp-kategorije {
    display: flex !important;
    flex-direction: row !important;
  }
  .cp-slika{
      max-width: 150px;
  }
}*/
@media (max-width: 991.98px) {
  /* primijeni SAMO kad je matični div: <div class="cp-proizvod cp-kategorije"> */
  .cp-proizvod.cp-kategorije {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;       /* po želji: vertikalno poravnanje */
    gap: 10px;                     /* mali razmak između slike i sadržaja */
  }

  /* ograniči širinu bloka sa slikom unutar te kartice */
  .cp-proizvod.cp-kategorije .cp-slika {
    max-width: 150px;
  }
  .cp-proizvod.cp-kategorije .cp-cijena {
    font-size: 20px !important;
  }
  .cp-proizvod.cp-kategorije .cp-title{
      height:auto !important;
      max-height:35px;
      padding-bottom: 0 !important;
  }
  .cp-proizvod.cp-kategorije .cp-ajax-add-to-cart {
    font-size: 13px !important;
  }

  /* da se slika skali unutar max-width */
  .cp-proizvod.cp-kategorije .cp-slika img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* neka sadržaj zauzme ostatak prostora */
  .cp-proizvod.cp-kategorije .cp-content {
    flex: 1 1 auto;
    min-width: 0;                  /* spriječi prelamanje/guranje */
  }
}

/* ===== Filter drawer (desni, 75% širine), bez donjih gumba ===== */

.cid-filter-btn{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.6rem .9rem; border:1px solid #e31e24; border-radius:999px;
  background:#fff; color:#e31e24; font-weight:600; cursor:pointer;
}
.cid-filter-btn:hover{ background:#ffecee; }

/* overlay iznad svega */
.cid-filter-overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,.45);
  z-index:999;
  opacity:0; transition:opacity .18s ease;
}
.cid-filter-overlay.is-open{ opacity:1; }

/* desni drawer */
.cid-filter-panel{
  position:fixed; top:0; right:0; bottom:0; left:auto;
  width:75vw; height:100vh; max-width:none;
  background:#fff;
  z-index:999;
  transform:translateX(100%); transition:transform .22s ease;
  display:flex; flex-direction:column;
  /*box-shadow:-24px 0 48px rgba(0,0,0,.18);*/
}
.cid-filter-panel.is-open{ transform:translateX(0); }

.cid-filter-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid #eee;
}
.cid-filter-header h3{ margin:0; font-size:24px !important; font-weight: 700; }
.cid-filter-close{
  border:0; background:transparent; font-size:28px; line-height:1; cursor:pointer;
}

/* scroll zona */
.cid-filter-body{
  padding:12px 16px 16px;
  overflow:auto;
  flex:1 1 auto;
}

/* zaključaj scroll dokumenta dok je otvoren panel */
body.cid-no-scroll{ overflow:hidden; touch-action:none; }

/* (neobavezno) malo ujednači YITH izgled */
.cid-filter-body .yith-wcan-filters .yith-wcan-filter{
  border-bottom:1px solid #eee; padding:10px 0;
}
.cid-filter-body .yith-wcan-filter .filter-title{
  display:flex; justify-content:space-between; align-items:center;
  font-weight:600; padding:8px 0; cursor:pointer;
}

/* po želji sakriti gumb na desktopu */
@media (min-width: 992px){
  .cid-filter-btn{ display:none; }
}

@media (max-width: 991px) {
  .yith-wcan-filters .yith-wcan-filter{
      margin-bottom: 0 !important;
  }
  .et-db #et-boc .et-l .et_pb_column {
    z-index: unset !important;  /* praktično isto kao auto u većini slučajeva */
  }
  .et-db #et-boc .et-l.et-l--header .et_builder_inner_content{
      z-index: unset !important;
  }
  .dipl_woo_products_ordering{
      display:none;
  }
  .cp-mobile-filters .et_pb_code_inner {
    display: flex !important;
    gap: 15px;
    flex-wrap: wrap;          /* ako pređe širinu, prelomi u novi red */
    align-items: center;      /* vertikalno poravnanje djece */
  }
  .cp-sp-c1{
      display: none;
  }
}
/* ============ SORT bottom sheet (stabilno sticky – bez transform) ============ */

/* dugme */
.cid-sort-btn{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.6rem .9rem; border:1px solid #e31e24; border-radius:999px;
  background:#fff; color:#e31e24; font-weight:600; cursor:pointer;
}
.cid-sort-btn:hover{ background:#ffecee; }
.cid-sort-icon{ font-weight:700; }

/* overlay + panel */
.cid-sort-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:10000;
  opacity:0; transition:opacity .18s ease;
}
.cid-sort-panel{
  position:fixed; left:0; right:0; bottom:-100svh; z-index:10001;
  background:#fff; border-top-left-radius:14px; border-top-right-radius:14px;
  /* NEMA transform-a! */
  transition:bottom .22s ease;
  display:flex; flex-direction:column; max-height:88svh;
  box-shadow:0 -20px 40px rgba(0,0,0,.18);
  overflow:hidden;                 /* roditelj ne scrolla */
  will-change: bottom;
}

.cid-sort-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid #eee;
}
.cid-sort-header h3{ margin:0; font-size:18px; }
.cid-sort-close{
  border:0; background:transparent; font-size:28px; line-height:1; cursor:pointer;
}

.cid-sort-body{
  padding:8px 16px 16px; overflow:auto; flex:1 1 auto;
  -webkit-overflow-scrolling: touch;
}
.cid-sort-option{
  display:flex; align-items:center; gap:.6rem;
  padding:10px 4px; border-bottom:1px solid #eee;
  cursor:pointer;
}
.cid-sort-option:last-child{ border-bottom:none; }
.cid-sort-option input{ accent-color:#e31e24; }

/* footer sticky – sada radi jer nema transform na roditelju */
.cid-sort-footer{
  position:sticky; bottom:0; display:flex; gap:10px;
  padding:12px 16px; background:#fff; border-top:1px solid #eee;
}
.cid-sort-clear{
  flex:0 0 auto; background:#f2f2f2; border:1px solid #ddd; color:#333;
  padding:.7rem 1rem; border-radius:10px; font-weight:600; cursor:pointer;
}
.cid-sort-apply{
  flex:1 1 auto; background:#e31e24; color:#fff; border:0;
  padding:.8rem 1rem; border-radius:10px; font-weight:700; cursor:pointer;
}

/* open state (bez transform) */
.cid-sort-overlay.is-open{ opacity:1; }
.cid-sort-panel.is-open{ bottom:0; }

/* blokiraj scroll kad je otvoreno */
body.cid-no-scroll{ overflow:hidden; touch-action:none; }

/* Sakrij Woo default select na mobu (ostavi na desktopu ako želiš) */
@media (max-width: 991.98px){
  .woocommerce-ordering{ display:none; }
}

/* Desktop: ako želiš zadržati samo klasični Woo dropdown, sakrij dugme ovdje */
@media (min-width: 992px){
  .cid-sort-btn{ display:none; }
}

/* iOS safe-area padding za dno (ako ima notch) */
.cid-sort-panel.is-open{
  padding-bottom: env(safe-area-inset-bottom, 0);
}
