/* ============================================================
   DINAR.COM.UA — Custom styles v4 (реальні класи JoomShopping)
   ============================================================ */

:root {
  --dn-accent:       #E9A020;
  --dn-accent-dark:  #C8861A;
  --dn-dark:         #1A1A2E;
  --dn-text:         #1F2937;
  --dn-muted:        #6B7280;
  --dn-border:       #E5E7EB;
  --dn-bg:           #F9FAFB;
  --dn-white:        #FFFFFF;
  --dn-green:        #16A34A;
  --dn-radius:       8px;
  --dn-radius-lg:    12px;
  --dn-shadow:       0 2px 12px rgba(0,0,0,.07);
  --dn-shadow-hover: 0 8px 28px rgba(0,0,0,.13);
}

/* ============================================================
   TOPBAR
   ============================================================ */
#sp-top-bar {
  background: var(--dn-dark) !important;
  padding: 7px 0;
  font-size: .82rem;
}
#sp-top-bar a,
#sp-top-bar .sp-contact-info li { color: rgba(255,255,255,.8) !important; }
#sp-top-bar a:hover { color: var(--dn-accent) !important; }
#sp-top-bar .sp-contact-info li i { color: var(--dn-accent) !important; }

/* ============================================================
   HEADER
   ============================================================ */
#sp-header {
  background: var(--dn-white) !important;
  border-bottom: 3px solid var(--dn-accent) !important;
  box-shadow: 0 2px 16px rgba(0,0,0,.08) !important;
}
#sp-header .logo a {
  font-size: 28px !important;
  font-weight: 700 !important;
  color: var(--dn-text) !important;
}
.sp-megamenu-parent > li > a,
.sp-megamenu-parent > li > span {
  font-size: .9rem !important;
  font-weight: 500;
  color: var(--dn-text) !important;
  transition: color .2s;
}
.sp-megamenu-parent > li > a:hover,
.sp-megamenu-parent > li.active > a { color: var(--dn-accent) !important; }

/* ============================================================
   JSHOPPING — СПИСОК КАТЕГОРІЙ
   Структура: .jshop_list_category > .row-fluid > .sblock3
   ============================================================ */
.jshop_list_category .row-fluid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 20px !important;
  padding: 10px 0 !important;
  width: 100% !important;
}

/* Картка категорії */
.jshop_list_category .sblock3 {
  background: var(--dn-white) !important;
  border: 1px solid var(--dn-border) !important;
  border-radius: var(--dn-radius-lg) !important;
  overflow: hidden !important;
  transition: border-color .2s, box-shadow .2s, transform .2s !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  float: none !important;
}
.jshop_list_category .sblock3:hover {
  border-color: var(--dn-accent) !important;
  box-shadow: var(--dn-shadow-hover) !important;
  transform: translateY(-3px);
}

/* ============================================================
   JSHOPPING — СПИСОК ТОВАРІВ
   Структура: .jshop_list_product > .row-fluid > .sblock3
   ============================================================ */
.jshop_list_product .row-fluid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 18px !important;
  padding: 10px 0 !important;
  width: 100% !important;
  clear: both !important;
}

/* Картка товару */
.jshop_list_product .sblock3 {
  background: var(--dn-white) !important;
  border: 1px solid var(--dn-border) !important;
  border-radius: var(--dn-radius-lg) !important;
  overflow: hidden !important;
  transition: border-color .2s, box-shadow .2s, transform .2s !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  float: none !important;
  display: flex !important;
  flex-direction: column !important;
}
.jshop_list_product .sblock3:hover {
  border-color: var(--dn-accent) !important;
  box-shadow: var(--dn-shadow-hover) !important;
  transform: translateY(-3px);
}

.jshop_list_product .block_product,
.jshop_list_category .block_product {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  padding: 0 !important;
}

/* Фото товару */
.jshop_list_product .image_block,
.jshop_list_category .image_block {
  background: var(--dn-bg) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  aspect-ratio: 1/1 !important;
  overflow: hidden !important;
  padding: 14px !important;
}
.jshop_list_product .image_block img,
.jshop_list_category .image_block img,
.jshop_list_product img.jshop_img,
.jshop_list_category img.jshop_img {
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  width: auto !important;
  height: auto !important;
  transition: transform .35s ease !important;
}
.jshop_list_product .sblock3:hover img { transform: scale(1.05) !important; }

/* Інфо блок */
.jshop_list_product .product,
.jshop_list_category .product {
  padding: 12px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  gap: 6px !important;
}

/* *** НАЗВА — головне виправлення червоного *** */
.jshop_list_product .name,
.jshop_list_product .name a,
.jshop_list_category .name,
.jshop_list_category .name a,
.com_jshopping .name a,
.com-jshopping .name a,
.jshop .name a,
body.com_jshopping .jshop_list_product a,
body.com_jshopping .jshop_list_category a {
  color: var(--dn-text) !important;
  font-size: .88rem !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  text-decoration: none !important;
}
.jshop_list_product .name a:hover,
.jshop_list_category .name a:hover {
  color: var(--dn-accent) !important;
}

/* Ціна */
.jshop_list_product .price_product,
.jshop_list_product .price,
.jshop_list_product .jshop_prod_price {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: var(--dn-text) !important;
  margin-top: auto !important;
  padding-top: 6px !important;
}

/* Стара ціна */
.jshop_list_product .old_price,
.jshop_list_product del,
.jshop_list_product .price_old {
  font-size: .8rem !important;
  color: var(--dn-muted) !important;
  text-decoration: line-through !important;
}

/* Наявність */
.jshop_list_product .product_not_available { color: #DC2626 !important; font-size: .78rem !important; }
.jshop_list_product .instock,
.jshop_list_product .product_available { color: var(--dn-green) !important; font-size: .78rem !important; }

/* Рейтинг */
.jshop_list_product .jshop_rating,
.jshop_list_product .rating { font-size: .78rem !important; }

/* Кнопка В кошик */
.jshop_list_product input.buy_button,
.jshop_list_product button.buy_button,
.jshop_list_product a.buy_button,
body.com_jshopping input.buy_button,
body.com_jshopping button.buy_button {
  display: block !important;
  width: 100% !important;
  margin-top: 10px !important;
  padding: 9px 14px !important;
  background: var(--dn-accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--dn-radius) !important;
  font-size: .85rem !important;
  font-weight: 600 !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: background .2s !important;
}
.jshop_list_product input.buy_button:hover,
.jshop_list_product button.buy_button:hover {
  background: var(--dn-accent-dark) !important;
}

/* ============================================================
   JSHOPPING — СОРТУВАННЯ
   ============================================================ */
.jshopSort, .jshop_orderby {
  background: var(--dn-bg) !important;
  border: 1px solid var(--dn-border) !important;
  border-radius: var(--dn-radius) !important;
  padding: 8px 14px !important;
  margin-bottom: 16px !important;
  font-size: .85rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}
.jshopSort select, .jshop_orderby select {
  border: 1px solid var(--dn-border) !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: .82rem !important;
  background: var(--dn-white) !important;
  color: var(--dn-text) !important;
}

/* ============================================================
   JSHOPPING — СТОРІНКА ТОВАРУ
   ============================================================ */
.jshop.productview h1,
.productview .product_name {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: var(--dn-text) !important;
}
.productview .price_product,
.productview .jshop_prod_price {
  font-size: 1.8rem !important;
  font-weight: 800 !important;
  color: var(--dn-accent) !important;
}
.productview input.buy_button,
.productview button.buy_button {
  padding: 12px 32px !important;
  font-size: 1rem !important;
  background: var(--dn-accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--dn-radius) !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: background .2s !important;
}
.productview input.buy_button:hover { background: var(--dn-accent-dark) !important; }

/* ============================================================
   САЙДБАР
   ============================================================ */
#sp-left .sp-module,
.sp-column.left .sp-module {
  background: var(--dn-white);
  border: 1px solid var(--dn-border) !important;
  border-radius: var(--dn-radius-lg) !important;
  padding: 18px !important;
  margin-bottom: 18px !important;
  box-shadow: var(--dn-shadow);
}
#sp-left .sp-module-title,
.sp-column.left .sp-module-title {
  font-size: .95rem !important;
  font-weight: 700 !important;
  color: var(--dn-text) !important;
  border-bottom: 2px solid var(--dn-accent) !important;
  padding-bottom: 10px !important;
  margin-bottom: 12px !important;
}
#sp-left .sp-module ul > li > a {
  color: var(--dn-text) !important;
  font-size: .85rem;
  display: block;
  padding: 4px 0;
  transition: color .15s, padding-left .15s;
}
#sp-left .sp-module ul > li > a:hover { color: var(--dn-accent) !important; padding-left: 5px; }
#sp-left .sp-module ul > li { border-bottom: 1px solid var(--dn-bg) !important; }

/* ============================================================
   FOOTER
   ============================================================ */
#sp-bottom {
  background: var(--dn-dark) !important;
  padding: 48px 0 28px !important;
  color: rgba(255,255,255,.7);
}
#sp-bottom a { color: rgba(255,255,255,.6) !important; transition: color .2s; }
#sp-bottom a:hover { color: var(--dn-accent) !important; }
#sp-bottom .sp-module-title { color: #fff !important; }
#sp-bottom ul > li { border-bottom: 1px solid rgba(255,255,255,.06) !important; }
#sp-footer { background: #0D0D1A !important; color: rgba(255,255,255,.45); }
#sp-footer .container-inner { border-top: 1px solid rgba(255,255,255,.08) !important; }
#sp-footer a { color: rgba(255,255,255,.45) !important; }
#sp-footer a:hover { color: var(--dn-accent) !important; }
.jshop_copyright { display: none !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .jshop_list_category .row-fluid,
  .jshop_list_product .row-fluid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 480px) {
  .jshop_list_category .row-fluid,
  .jshop_list_product .row-fluid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  /* Сортування на мобільному — не ламає grid */
  .jshopSort,
  .jshop_orderby {
    float: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 12px !important;
  }
  .jshopSort select,
  .jshop_orderby select {
    width: 100% !important;
  }
}
