/* ==========================================================================
   BASE STYLESHEET
   Shared rules for all themes. No :root{} blocks here — those live in
   each theme file. All colors must reference CSS custom properties.
   ========================================================================== */

:root {
  --color-backlight: color-mix(in srgb, var(--color-backback) 30%, white);
  --bs-breadcrumb-divider: '›';
  --btn-text: #ffffff;
  --bs-btn-border-radius: 6px;
}

body {
  font-family: 'Exo 2', 'Open Sans', sans-serif;
  font-weight: 300;
  color: var(--color-text);
  font-size: 15px;
  line-height: 20px;
  background-color: var(--color-backback);
}

/* Limit ultra-wide site width */
.container-fluid {
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
}

h1 { font-size: 32px; }
h2 { font-size: 30px; }
h3 { font-size: 27px; }
h4 { font-size: 21px; }
h5 { font-size: 15px; }
h6 { font-size: 12px; }

a {
  color: var(--link-color);
}

a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

legend {
  font-size: 18px;
  padding: 7px 0;
}

label {
  font-size: 0.8em;
  font-weight: normal;
}

/* Forms — font size and focus color */
.form-control,
.input-group-text,
.input-group input,
.input-group select {
  font-size: 12px;
}

.form-control {
  background-color: var(--color-backback);
  border-radius: 0;
  box-shadow: none !important;
  transition: 0.4s ease all;
}

.form-control:focus,
select:focus,
textarea:focus {
  border-color: var(--color-main);
}

select,
textarea,
input[type='text'],
input[type='password'],
input[type='email'],
input[type='tel'],
input[type='number'],
input[type='search'],
input[type='url'],
input[type='time'] {
  border-radius: 0;
  box-shadow: none !important;
  transition: 0.4s ease all;
}

div.required .control-label:before {
  content: '* ';
  color: var(--color-danger);
  font-weight: bold;
}

/* Dropdown menus */
.dropdown-menu li > a:hover {
  text-decoration: none;
  color: var(--color-backwhite);
  background-color: var(--color-main);
}

.dropdown-menu {
  border-radius: 4px;
  background-color: var(--color-backwhite);
  border: 1px solid var(--color-border-mid);
  box-shadow: 0 4px 12px var(--rgba-black-02);
}

.dropdown-item { color: var(--heading-color) !important; }

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--color-main) !important;
  color: var(--color-backwhite) !important;
}

.dropdown-item.active,
.dropdown-item.selected {
  background-color: color-mix(in srgb, var(--color-main) 15%, transparent) !important;
  color: var(--heading-color) !important;
}

/* Footer */
footer {
  margin-top: 0;
  background-color: var(--footer-bg, #303030);
  color: var(--footer-text, #e2e2e2);
}


footer hr {
  border-top: none;
  border-bottom: 1px solid var(--color-border-mid);
}

footer a { color: var(--footer-text); }
footer a:hover { color: var(--color-backwhite); }

footer h5 {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: var(--color-backwhite);
}

.copyright {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
}

/* Layout */
main {
  background-color: var(--color-backback);
  margin: 0;
  padding: 0;
}

/* Cards */
.card { border: none; }
.card-footer { border: none; background-color: initial; }

/* Tabs */
.tab-content {
  background-color: var(--color-backback);
  padding: 1rem;
}

/* Breadcrumb */
.breadcrumb {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 8px 0;
  border-radius: 0;
  background-color: initial;
}

.breadcrumb a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--link-color);
  text-decoration: none;
}

/* Pagination */
.pagination {
  margin: 0;
  --bs-pagination-color: var(--color-main);
  --bs-pagination-hover-color: var(--color-main);
  --bs-pagination-focus-color: var(--color-main);
  --bs-pagination-active-color: var(--color-backwhite);
  --bs-pagination-active-bg: var(--color-main);
  --bs-pagination-active-border-color: var(--color-main);
  --bs-pagination-border-color: transparent;
  --bs-pagination-hover-border-color: transparent;
  --bs-pagination-focus-border-color: transparent;
  --bs-pagination-disabled-border-color: transparent;
  --bs-pagination-bg: transparent;
  --bs-pagination-hover-bg: color-mix(in srgb, var(--color-main) 12%, transparent);
  --bs-pagination-focus-bg: color-mix(in srgb, var(--color-main) 12%, transparent);
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--color-main) 25%, transparent);
}

.pagination .page-link { border-radius: 4px !important; }

.pagination .page-item.loaded:not(.active) .page-link {
  background-color: color-mix(in srgb, var(--color-main) 20%, transparent);
  color: var(--color-main);
}

.paginator {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

/* Infinite scroll */
.scroll-sentinel {
  height: 1px;
  visibility: hidden;
}

.page-loader { padding: 0.5rem 0; }

.page-loader-bar {
  height: 4px;
  border-radius: 0;
  background-color: color-mix(in srgb, var(--color-main) 20%, transparent);
}

.page-loader-bar .progress-bar { background-color: var(--color-main); }

/* Buttons */
.btn { border-radius: 6px; }
.btn-link { border-radius: 0; }
.btn-link:focus, .btn-link:hover { color: var(--link-color); }

.buttons {
  margin: 1em 0;
  display: flex;
  justify-content: space-between;
}

.buttons .btn { margin: 0 1rem; }
.buttons .btn:first-child { margin-left: 0; }
.buttons .btn:last-child { margin-right: 0; }

/* Form check */
.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

/* List group */
.list-group a {
  border: 0;
  padding: 8px 12px;
}

.list-group a.active,
.list-group a.active:hover,
.list-group a:hover {
  color: var(--heading-color);
  background-color: var(--rgba-black-01);
}

.list-group-item { background-color: initial; }
.list-group { margin-top: 1em; }

/* Alerts */
.alert { border-radius: 0; }

/* Tables */
.table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > td,
.table-bordered > tfoot > tr > th {
  border: 1px solid var(--color-border);
}

.table-bordered > thead > tr > td,
.table-bordered > thead > tr > th {
  border: 1px solid transparent;
  border-bottom: 1px solid var(--color-border);
}

/* Header */
header {
  margin-bottom: 0;
  background-color: var(--header-bg);
  position: relative;
}

.header-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1rem;
}

.logo-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.search-block {
  flex: 1 1 auto;
  max-width: 600px;
}

.right-block {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: nowrap;
  padding-right: 2.5rem;
}

.contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.configure-dropdown {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 100;
}

.btn-configure {
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  color: var(--heading-color);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.btn-configure:hover { opacity: 0.65; }

/* Phone */
header .phone {
  color: var(--color-main);
  font-size: 20px;
  line-height: 32px;
  font-weight: 500;
}

header .phone a { color: var(--color-main); text-decoration: none; }
header .phone a:hover { text-decoration: none; }
.phone a:hover { text-decoration: none; }
.phone a span { font-size: 0.7em; }

.phone.kyivstar,
.phone.lifecell,
.phone.vodafone {
  background-size: 18px;
  background-position: 100% center;
  padding-right: 25px;
  background-repeat: no-repeat;
}

/* Navbar / menu */
.navbar { font-size: 1.4rem; }

#menu {
  background-color: var(--color-main);
  min-height: 40px;
}

#menu .nav > li > a {
  color: var(--color-backwhite);
  padding: 10px 15px;
  min-height: 15px;
  background-color: transparent;
  text-transform: uppercase;
  font-weight: bold;
}

#menu .nav > li > a:hover,
#menu .nav > li.open > a {
  background-color: var(--rgba-black-01);
}

#menu .dropdown-menu { padding-bottom: 0; }

#menu .dropdown-inner {
  display: table;
  width: 100%;
}

#menu .dropdown-inner ul { display: table-cell; }

#menu .dropdown-inner a {
  min-width: 160px;
  display: block;
  padding: 3px 20px;
  clear: both;
  line-height: 20px;
  color: var(--active-color);
  font-size: 12px;
}

#menu .dropdown-inner li a:hover { color: var(--color-backwhite); }

#menu .see-all {
  display: block;
  margin-top: 0.5em;
  border-top: 1px solid var(--color-border);
  padding: 3px 20px;
  font-size: 12px;
}

#menu .see-all:hover,
#menu .see-all:focus {
  text-decoration: none;
  color: var(--color-backwhite);
  background-color: var(--color-main);
}

#menu .btn-navbar {
  font-size: 15px;
  color: var(--color-backwhite);
  padding: 2px 18px;
  background-color: transparent;
  box-shadow: initial;
}

#menu .btn-navbar:hover,
#menu .btn-navbar:focus,
#menu .btn-navbar:active,
#menu .btn-navbar.disabled,
#menu .btn-navbar[disabled] {
  color: var(--color-backwhite);
}

/* Categories bar */
.categories-bar {
  margin: 0;
  padding: 0;
}

.header-bar-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.categories-bar .search-block {
  min-width: 0;
}

.categories-bar #search { flex-wrap: nowrap; }

/* Scope selector */
.search-scope {
  position: relative;
  flex-shrink: 0;
}
.scope-btn {
  display: flex;
  align-items: center;
  gap: 0.3em;
  height: 36px;
  padding: 0 0.6rem;
  background-color: var(--categories-bar-input-bg);
  color: var(--categories-bar-input-text);
  border: 1px solid var(--categories-bar-input-border);
  border-left: none;
  border-right: none;
  border-radius: 0;
  white-space: nowrap;
  cursor: pointer;
  font-size: 0.8rem;
  max-width: 150px;
}
.scope-btn #scope-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-chevron {
  font-size: 0.65em;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.scope-btn[aria-expanded="true"] .scope-chevron { transform: rotate(180deg); }
.scope-dropdown {
  position: absolute;
  bottom: calc(100% + 2px);
  right: 0;
  z-index: 1050;
  min-width: 180px;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 4px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.15);
  display: none;
}
.scope-dropdown.open { display: block; }
.scope-option {
  display: block;
  padding: 0.45rem 0.75rem;
  color: var(--bs-body-color);
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}
.scope-option:hover { background: var(--bs-secondary-bg); }
.scope-option.active { color: var(--color-main); font-weight: 500; }

.categories-bar #search .form-control {
  background-color: var(--categories-bar-input-bg);
  border-color: var(--categories-bar-input-border);
  color: var(--categories-bar-input-text);
  border-radius: 4px 0 0 4px;
  height: 36px;
  font-size: 0.875rem;
}

.categories-bar #search .form-control::placeholder {
  color: var(--categories-bar-input-text);
  opacity: 0.6;
}

.categories-bar #search .form-control:focus {
  box-shadow: none;
  border-color: var(--categories-bar-input-border);
  background-color: var(--categories-bar-input-bg);
  color: var(--categories-bar-input-text);
}

.categories-bar #search button#search-btn {
  background-color: var(--categories-bar-btn-bg);
  color: var(--categories-bar-btn-text);
  border: 1px solid var(--categories-bar-input-border) !important;
  border-left: none !important;
  border-radius: 0 4px 4px 0;
  height: 36px;
  padding: 0 0.75rem;
  flex-shrink: 0;
}

.categories-bar #search button#search-btn:hover {
  background-color: color-mix(in srgb, var(--categories-bar-btn-bg) 100%, white 20%);
  opacity: 1;
}

.catalog-btn {
  color: var(--categories-bar-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 18px;
  padding: 10px;
  margin-right: 10px;
}

.catalog-btn:hover {
  opacity: 0.8;
  color: var(--categories-bar-text);
  text-decoration: none;
}

/* Spinner for Bootstrap Icons */
@keyframes bi-spin-anim {
  to { transform: rotate(360deg); }
}

.bi-spin {
  display: inline-block;
  animation: bi-spin-anim 1s linear infinite;
}

/* Category page */
.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.category-header h2 { margin: 0; }

.product-count {
  font-size: 0.85rem;
  color: var(--color-muted);
  white-space: nowrap;
}

/* Product grid */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.products-area { position: relative; }

.sort-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: linear-gradient(to bottom, var(--color-backback) 50%, transparent);
  padding-bottom: 1rem;
}

/* Product card */
.product-layout {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.product-layout:hover { text-decoration: none; }

.product-layout .product-thumb { width: 100%; }

@keyframes card-wave {
  0%   { box-shadow: 0 0 0 0px rgba(206, 177, 125, 0.55), 0 0 0 1px var(--color-main), 0 8px 24px rgba(0,0,0,0.18); }
  100% { box-shadow: 0 0 0 10px rgba(206, 177, 125, 0),   0 0 0 1px var(--color-main), 0 8px 24px rgba(0,0,0,0.18); }
}

.product-thumb {
  display: flex;
  flex-direction: column;
  background: var(--color-backlight);
  height: 100%;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-thumb:hover {
  animation: card-wave 0.6s ease-out forwards;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.13);
}

.product-thumb .image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
  margin: 0.4rem;
  border-radius: 6px;
}

.product-thumb .image a {
  display: block;
  height: 100%;
}

.product-thumb .image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-thumb:hover .image img { transform: scale(1.05); }

.product-thumb .caption {
  flex: 1;
  padding: 0.75rem 1rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.product-thumb .caption .product-name {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--heading-color);
  text-decoration: none;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-thumb .caption .product-name:hover { color: var(--color-main); }

.button-group {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
}

.button-group .price {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-main);
  margin: 0;
  white-space: nowrap;
}

.button-group .price-new { color: var(--color-main); }

.button-group .price-old {
  color: var(--color-price-old);
  text-decoration: line-through;
  font-weight: 400;
  font-size: 0.8em;
  display: block;
}

.button-group .price-tax { display: none; }

.btn-cart {
  flex-shrink: 0;
  border: 0;
  background-color: var(--color-main);
  color: var(--btn-text);
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-top-left-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-layout:hover .btn-cart,
.btn-cart:hover {
  background-color: color-mix(in srgb, var(--color-main) 85%, black);
}


/* Sidebar */
#sidebar-left { background-color: var(--color-backlight); }

#sidebar-left .card {
  background-color: var(--color-backlight);
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#sidebar-left .list-group-item {
  background-color: var(--color-backlight);
  border: none;
}

#sidebar-left .list-group a { border: none; }

aside#column-right {
  border-left: 1px solid var(--color-aside-border);
}

/* Cart/action btn-groups — exclude image swatch groups */
:not([data-option_type="image"]) > .btn-group .btn.btn-outline-secondary {
  background-color: var(--color-main);
  background-image: initial;
  border: 0;
}

:not([data-option_type="image"]) > .btn-group .btn-outline-secondary.btn:hover {
  background-color: var(--color-warning-mid);
}

:not([data-option_type="image"]) > .btn-group .btn {
  color: var(--color-backwhite);
  text-transform: uppercase;
}

/* Image option swatches */
[data-option_type="image"] .btn-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 0.4rem;
  position: relative;
}

[data-option_type="image"] .btn-group > :not(.btn-check:first-child) + .btn {
  margin-left: 0;
}

[data-option_type="image"] .btn-group .btn {
  padding: 0;
  border-radius: 6px !important;
  border: 2px solid transparent;
  overflow: hidden;
  --bs-btn-bg: var(--color-backback);
  color: var(--heading-color) !important;
  text-transform: none !important;
  position: relative;
  transition: border-color 0.15s ease;
}

[data-option_type="image"] .btn-group .btn img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  display: block;
}

[data-option_type="image"] .btn-group > .btn-check:checked + .btn {
  border-color: var(--color-main);
}

[data-option_type="image"] .btn-group > .btn-check:checked + .btn::after {
  content: '✓';
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--color-main);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

/* Product page */
#content h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.price-notification {
  color: var(--color-danger);
  margin-bottom: 0.4rem;
}

.bg-body-secondary { background-color: var(--color-backlight) !important; }
.bg-body-secondary.rounded { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }

.control-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 1rem 0 0.5rem 0;
}

figcaption.product-code {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 0;
}

figure:has(> figcaption.product-code) { margin: 0; }

.selected-option-name {
  color: var(--color-main);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.html-module-content p:last-child { margin-bottom: 0; }
.html-module-content p { margin-bottom: 0.4rem; }

.section-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 0 0 0.5rem 0;
}

.product-description-content {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
}

.price-tax-line {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.2rem;
}

/* Specification grid */
.spec-grid { display: grid; grid-template-columns: 1fr; }

.spec-group-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 1rem 0 0.25rem 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-group-name:first-child { margin-top: 0; }

.spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
  padding: 0.3rem 0 0.3rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border-mid) 40%, transparent);
}

.spec-row:last-child { border-bottom: none; }
.spec-name, .spec-value { color: var(--color-text); font-size: 0.9rem; }

/* Color/Image product options — legacy radio fallback (unused in current template) */
[data-option_type='image'] input[type="radio"] { display: none; }

[data-option_type='image'] input[type="radio"]:checked + img {
  outline: 3px solid var(--color-outline);
  outline-offset: 0;
}

[data-option_name='color'] .option-checkmark,
[data-option_name] .option-checkmark,
[data-option_type='image'] .option-checkmark {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  background-color: var(--color-main);
  color: var(--color-backwhite);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transform: translate(50%, 50%);
}

[data-option_name='color'] input[type="radio"]:checked ~ .option-checkmark,
[data-option_name] input[type="radio"]:checked ~ .option-checkmark,
[data-option_type='image'] input[type="radio"]:checked ~ .option-checkmark {
  display: inline-flex !important;
}

.form-group .option-label-wrapper {
  position: relative;
  margin-bottom: 10px;
}

.form-group .option-label-wrapper .control-label { margin-bottom: 0; }

.form-group .option-label-wrapper .selected-option-name {
  color: var(--color-outline);
  font-weight: 500;
  font-size: 1.05rem;
}

.img-thumbnail {
  border-radius: 0;
  background-color: transparent;
  box-sizing: border-box;
  padding: 0;
  color: var(--color-text);
}

.img-thumbnail img,
.img-thumbnail svg {
  max-width: 100%;
  height: auto;
  min-width: 50px;
  min-height: 50px;
  width: auto;
  display: block;
}

[data-option_name] .img-thumbnail img,
[data-option_name] .img-thumbnail svg,
[data-option_type="image"] .img-thumbnail img,
[data-option_type="image"] .img-thumbnail svg {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

/* Quantity input */
input#input-quantity {
  width: 40px;
  background-color: var(--color-main);
  color: var(--color-backwhite);
  font-weight: 700;
  border: none;
}

input#input-quantity:hover { background-color: var(--color-warning-mid); }

/* Coupon */
.coupon {
  display: flex;
  margin: 10px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
}

.coupon label { flex: 1 0; }
.coupon #button-coupon { flex: 0 0; }
.coupon #input-coupon { flex: 1 0; }

/* Option description */
.option_desc {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--color-option-desc);
  margin-top: 0.25rem;
}

.option_desc a { color: var(--color-option-desc); }

/* Product gallery */
.thumbnails {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  overflow: auto;
  clear: both;
}

.thumbnails > img { width: 100%; }

.image-additional a {
  margin-bottom: 20px;
  padding: 5px;
  display: block;
  border: 1px solid var(--color-border);
}

.image-additional { max-width: 78px; }

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: var(--color-backlight);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.main-image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-backlight);
  border-radius: 8px;
  overflow: hidden;
}

.main-image-wrapper {
  position: relative;
  width: 100%;
  text-align: center;
}

#main-product-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--rgba-white-09);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--active-color);
  opacity: 0;
  pointer-events: none;
}

.main-image-container:hover .gallery-nav {
  opacity: 1;
  pointer-events: auto;
}

.gallery-nav:hover {
  background: var(--color-main);
  color: var(--color-backwhite);
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }

.zoom-button {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: var(--rgba-white-09);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--active-color);
  box-shadow: 0 2px 8px var(--rgba-black-015);
}

.zoom-button:hover {
  background: var(--color-main);
  color: var(--color-backwhite);
  transform: scale(1.1);
}

.thumbnails-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.thumbnail-item {
  width: 80px;
  height: 80px;
  border: 1px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: var(--color-backlight);
}

.thumbnail-item img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail-item:hover { border-color: var(--color-main); }

.thumbnail-item.active {
  border-color: var(--color-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Zoom gallery fullscreen */
.zoom-gallery {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--rgba-black-095);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-gallery-content {
  position: relative;
  width: 90%;
  height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-image-wrapper {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zoom-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--rgba-white-02);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--color-backwhite);
  z-index: 10001;
}

.zoom-close:hover { background: var(--rgba-white-04); transform: scale(1.1); }

.zoom-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--rgba-white-02);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--color-backwhite);
}

.zoom-nav:hover { background: var(--color-main); transform: translateY(-50%) scale(1.1); }
.zoom-nav.prev { left: 30px; }
.zoom-nav.next { right: 30px; }

/* Mirror effect */
body.mirrored .mfp-content .mfp-img,
.mirror { transform: scaleX(-1); }

/* Owl Carousel */
.owl-carousel { background-color: transparent !important; }
.owl-wrapper-outer { border-radius: 0 !important; border: 0 !important; }

.owl-carousel .title { position: absolute; z-index: 10; }
.owl-carousel .title a { color: var(--color-carousel-title); text-shadow: var(--text-shadow-large); }
.owl-carousel .title a:hover { text-decoration: none; }

/* CD Popup */
.cd-popup {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background-color: var(--rgba-popup-bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s 0s, visibility 0s .3s;
  z-index: 9;
}

.cd-popup.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s 0s, visibility 0s 0s;
}

.cd-popup.is-visible .cd-popup-container {
  transform: translateY(0);
  min-height: 200px;
}

.cd-popup-container {
  position: relative;
  width: 90%;
  max-width: 800px;
  margin: 4em auto;
  background: var(--color-backwhite);
  text-align: center;
  box-shadow: 0 0 20px var(--rgba-black-02);
  transform: translateY(-40px);
  transition: transform .3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.cd-popup-container p { padding: 3em 1em; }
.cd-popup-container ul { list-style: none; margin: 0; padding: 0; }

.cd-popup-container .cd-buttons {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.cd-popup-container .cd-buttons li {
  background: var(--color-main);
  padding: 1rem;
  margin: 0 2px;
  width: 100%;
}

.cd-popup-container .cd-buttons li:hover { background: var(--color-warning-mid); }
.cd-popup-container .cd-buttons li:first-child { margin-left: 0; }
.cd-popup-container .cd-buttons li:last-child { background: var(--color-danger-2); margin-right: 0; }

.cd-popup-container .cd-buttons a {
  display: block;
  text-transform: uppercase;
  color: var(--color-backwhite);
  transition: background-color .2s;
}

.cd-popup-container .cd-buttons a:hover { text-decoration: none; }

.cd-popup-container .cd-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
}

.cd-popup-container .cd-popup-close::before,
.cd-popup-container .cd-popup-close::after {
  content: '';
  position: absolute;
  top: 12px;
  width: 14px;
  height: 3px;
  background-color: var(--color-close);
}

.cd-popup-container .cd-popup-close::before { transform: rotate(45deg); left: 8px; }
.cd-popup-container .cd-popup-close::after { transform: rotate(-45deg); right: 8px; }

/* Cart */
.cart-table thead {
  background-color: var(--color-main);
  color: var(--color-backwhite);
  font-weight: 500;
}

.cart-cart { background-color: var(--color-backback); }
.cart-cart table { background-color: var(--color-backwhite); }
.cart-cart .buttons { padding: 3rem; }

/* LDSP */
.ldsp { display: flex; flex-wrap: wrap; justify-content: space-between; }

.ldsp figure {
  background-color: var(--color-backwhite);
  box-shadow: 0 4px 8px var(--rgba-black-02);
  margin: 1rem;
}

.ldsp figure figcaption {
  background-color: var(--color-main);
  text-align: center;
  font-size: 1.2em;
  line-height: 40px;
  color: var(--color-backwhite);
  font-weight: 600;
}

.ldsp figure img {
  object-fit: cover;
  object-position: left;
  display: block;
  margin: 0 auto;
  height: 100%;
}

.ldsp figure div { height: 300px; }

/* Catalog full-screen overlay */
.catalog-overlay {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  background: var(--color-backback);
  overflow-y: auto;
}

.catalog-overlay.open { display: block; }
body.catalog-overlay-open { overflow: hidden; }

.catalog-overlay-inner {
  position: relative;
  min-height: 100%;
  padding: 3rem 2rem 2rem;
}

.catalog-overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--heading-color);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.catalog-overlay-close:hover { opacity: 0.65; }

.catalog-overlay-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  align-items: start;
}

.catalog-section-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading-color);
  text-decoration: none;
  margin-bottom: 0.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-main);
}

.catalog-section-title:hover { color: var(--color-main); }

.catalog-subcategories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.catalog-subcat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid var(--color-border-mid);
  border-radius: 8px;
  padding: 0.6rem 0.4rem 0.5rem;
  transition: border-color 0.15s, color 0.15s;
  background: var(--color-backwhite);
}

.catalog-subcat-card:hover { border-color: var(--color-main); color: var(--heading-color); }

.catalog-subcat-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.catalog-subcat-card span { font-size: 0.75rem; line-height: 1.3; }

.catalog-show-all {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-main);
  text-decoration: none;
}

.catalog-show-all:hover {
  color: var(--color-main);
  text-decoration: underline;
}

/* Misc */
.uah-text { font-size: 0.6em; color: var(--color-uah); margin-left: 0.3em; }
.model { font-size: 0.7em; }
.contacts { text-align: right; }

/* ── Mobile: ≤ 767px ─────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 2.5rem;
  }

  .logo-block { order: 1; }
  .search-block { order: 2; max-width: none; width: 100%; }
  .right-block { order: 3; flex-wrap: wrap; justify-content: flex-end; }
#menu div.dropdown-inner > ul.list-unstyled { display: block; }
  #menu div.dropdown-menu { margin-left: 0 !important; padding-bottom: 10px; background-color: rgba(0,0,0,0.1); }
  #menu .dropdown-inner { display: block; }
  #menu .dropdown-inner a { width: 100%; color: var(--color-backwhite); }
  #menu .dropdown-menu a:hover,
  #menu .dropdown-menu ul li a:hover { background: rgba(0,0,0,0.1); }
  #menu .see-all { margin-top: 0; border: none; border-radius: 0; color: var(--color-backwhite); }

  .thumbnail-item { width: 60px; height: 60px; }
  .gallery-nav { width: 35px; height: 35px; font-size: 16px; }
  .zoom-button { width: 40px; height: 40px; font-size: 16px; }
  .zoom-nav, .zoom-close { width: 40px; height: 40px; font-size: 20px; }
  .zoom-nav.prev { left: 10px; }
  .zoom-nav.next { right: 10px; }

  .catalog-overlay-inner { padding: 3rem 1rem 1.5rem; }
  .catalog-subcategories { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .catalog-subcat-card img { width: 56px; height: 56px; }

  #sidebar-left .offcanvas-body { background-color: var(--color-backlight); }

  .owl-carousel .title { font-size: 4rem; bottom: 1rem; left: 1rem; }
}

/* ── Desktop: ≥ 768px ────────────────────────────────────────────── */
@media (min-width: 768px) {
  #menu .dropdown:hover .dropdown-menu { display: block; }
  .owl-carousel .title { font-size: 9rem; bottom: 5rem; left: 1rem; }
}
