/* ==========================================================================
   THEME COMPONENTS — unified color layer (loads after custom.css)
   All surfaces use CSS variables from theme.css
   ========================================================================== */

/* --- Base --- */
body,
html,
.wrapper {
    background-color: var(--background-primary) !important;
    color: var(--text-primary) !important;
}

/* --- Product cards --- */
.product_card_inner {
    background: var(--theme-card-bg) !important;
    border-color: var(--theme-card-border) !important;
    box-shadow: var(--theme-card-shadow) !important;
}

.product_card:hover .product_card_inner {
    box-shadow: var(--theme-card-shadow-hover) !important;
}

.product_card_media {
    background: var(--theme-card-media-bg) !important;
}

.product_card_cat {
    background: var(--theme-badge-cat-bg) !important;
    color: var(--theme-badge-cat-text) !important;
}

.product_card_sale_badge {
    background: var(--theme-badge-sale-bg) !important;
    color: var(--theme-badge-sale-text) !important;
}

.product_card_sale_pct {
    background: var(--theme-badge-pct-bg) !important;
    color: var(--theme-badge-pct-text) !important;
}

.product_card_title {
    color: var(--theme-text) !important;
}

.product_card:hover .product_card_title {
    color: var(--theme-primary) !important;
}

.product_card_desc {
    color: var(--theme-text-muted) !important;
}

/* --- Prices --- */
.price_current {
    color: var(--theme-text-price) !important;
}

.price_block.is-sale .price_current {
    color: var(--theme-text-price-sale) !important;
}

.price_old {
    color: var(--theme-text-price-old) !important;
}

/* --- Sections --- */
.section_title,
#product .section_title,
#cart .title,
#product_text .title {
    color: var(--theme-text) !important;
}

.section_desc {
    color: var(--theme-text-muted) !important;
}

#about,
#similar_products {
    background: var(--theme-bg-subtle) !important;
}

.home_section {
    background: transparent;
}

/* --- Tags --- */
#product_item .tags li {
    background: var(--theme-badge-tag-bg) !important;
    color: var(--theme-badge-tag-text) !important;
}

/* --- Product page --- */
#product_item .product_lead_inner {
    background: var(--theme-card-bg) !important;
    border-color: var(--theme-card-border) !important;
}

#product_item .product_lead_inner::before {
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%) !important;
}

#product_item .product_lead_text {
    color: var(--theme-text-muted) !important;
}

.product_desc_card {
    background: var(--theme-card-bg) !important;
    border-color: var(--theme-card-border) !important;
}

.product_desc_label {
    color: var(--theme-primary) !important;
    background: var(--theme-bg-subtle) !important;
    border-color: var(--theme-border) !important;
}

.product_desc_title {
    color: var(--theme-text) !important;
}

.product_desc_text {
    color: var(--theme-text-muted) !important;
}

.product_desc_text:first-child {
    color: var(--theme-text) !important;
}

#product_item .product_title,
#product_item .title {
    color: var(--theme-text) !important;
}

#product_item .product_page_price {
    border-top-color: var(--theme-divider) !important;
}

#product_item .product_back a {
    color: var(--theme-text-link) !important;
}

#product_item .product_back a:hover {
    color: var(--theme-text-link-hover) !important;
}

#product_item .gallery_main {
    background: var(--theme-card-media-bg) !important;
    box-shadow: var(--theme-shadow-md) !important;
}

#product_item .gallery_thumb {
    border-color: transparent !important;
}

#product_item .gallery_thumb.is-active {
    border-color: var(--theme-primary) !important;
}

/* --- Cart page --- */
#cart .cart_total {
    background: var(--theme-card-bg) !important;
    border-color: var(--theme-card-border) !important;
    box-shadow: var(--theme-shadow-sm) !important;
}

#cart .cart_list .cart_item {
    background: var(--theme-card-bg) !important;
    box-shadow: var(--theme-shadow-sm) !important;
}

#cart .cart_total .name,
#cart .cart_total .count,
#cart .cart_total .total {
    color: var(--theme-primary) !important;
}

#cart .cart_item .name,
#cart .cart_item .desc {
    color: var(--theme-text) !important;
}

#cart .cart_item .desc {
    color: var(--theme-text-muted) !important;
}

/* --- Floating cart --- */
#cart_button a {
    background: var(--theme-cart-float-bg) !important;
    color: var(--theme-cart-float-text) !important;
}

#cart_button:hover {
    background-color: transparent !important;
}

#cart_button a:hover {
    background: var(--theme-cart-float-bg-hover) !important;
    color: var(--theme-cart-float-text) !important;
}

#cart_count,
.header_cart_count,
.mobile_nav_cart_badge:not(:empty) {
    background: var(--theme-cart-badge-bg) !important;
    color: var(--theme-cart-badge-text) !important;
}

/* --- Header nav --- */
.header_cart {
    background: var(--theme-nav-hover) !important;
    color: var(--theme-icon) !important;
}

.header_cart:hover {
    background: var(--theme-btn-primary-bg) !important;
    color: var(--theme-btn-primary-text) !important;
}

.header .hmp {
    background: var(--theme-nav-hover) !important;
    color: var(--theme-icon) !important;
}

.header .hmp:hover,
.header .hmp.active {
    background: var(--theme-btn-primary-bg) !important;
    color: var(--theme-btn-primary-text) !important;
}

/* Hamburger bars inherit button text on active/hover */
.header .hmp:hover span,
.header .hmp:hover span::before,
.header .hmp:hover span::after,
.header .hmp.active span,
.header .hmp.active span::before,
.header .hmp.active span::after {
    background-color: var(--theme-btn-primary-text) !important;
}

/* --- Custom order promo --- */
.custom_order_card {
    background: var(--theme-promo-bg) !important;
    color: var(--theme-promo-text) !important;
}

.custom_order_card .section_title,
.custom_order_card .section_desc {
    color: var(--theme-promo-text) !important;
}

/* --- Contacts --- */
.contacts_item,
.contacts_block {
    background: var(--theme-card-bg) !important;
    border-color: var(--theme-card-border) !important;
}

.contacts_item a {
    color: var(--theme-text-link) !important;
}

.contacts_item a:hover {
    color: var(--theme-text-link-hover) !important;
}

/* --- Modals --- */
.remodal {
    background: var(--theme-modal-bg) !important;
    color: var(--theme-text) !important;
}

.remodal-overlay {
    background: var(--theme-modal-overlay) !important;
}

.remodal .ds_form .form_item label {
    color: var(--theme-text) !important;
}

.remodal .ds_form input,
.remodal .ds_form select,
.remodal .ds_form textarea {
    background: var(--theme-input-bg) !important;
    color: var(--theme-input-text) !important;
    border-color: var(--theme-input-border) !important;
}

.remodal .ds_form input::placeholder,
.remodal .ds_form textarea::placeholder {
    color: var(--theme-input-placeholder) !important;
}

.remodal .ds_form input:focus,
.remodal .ds_form select:focus,
.remodal .ds_form textarea:focus {
    border-color: var(--theme-primary) !important;
}

.remodal .msg {
    color: var(--theme-error) !important;
}

.remodal h2 {
    color: var(--theme-text) !important;
}

.crtok .desc {
    color: var(--theme-text) !important;
}

.crtok .check {
    background: var(--theme-bg-subtle) !important;
    color: var(--theme-text-muted) !important;
}

.form_note {
    color: var(--theme-text-subtle) !important;
}

/* --- Cart widget --- */
.product_buy_controls {
    background: var(--theme-btn-primary-bg) !important;
}

.product_buy .minus,
.product_buy .plus,
.product_buy .product_count {
    color: var(--theme-btn-primary-text) !important;
}

/* --- Legacy list items (non product_card) --- */
#product .list .item:not(.product_card) {
    background-color: var(--theme-card-bg) !important;
}

/* --- Mobile nav --- */
.mobile_nav_panel {
    background: var(--theme-nav-mobile-bg) !important;
}

.mobile_nav_close {
    background: var(--theme-nav-hover) !important;
    color: var(--theme-icon) !important;
}

.mobile_nav_close:hover {
    background: var(--theme-primary) !important;
    color: var(--theme-icon-inverse) !important;
}

.mobile_nav_cats a,
.mobile_nav_contact {
    color: var(--theme-text) !important;
}

.mobile_nav_cats a:hover {
    background: var(--theme-nav-hover) !important;
    color: var(--theme-primary) !important;
}

.mobile_nav_contact icon {
    color: var(--theme-icon-muted) !important;
}

/* --- Footer social --- */
footer .social_btn a {
    background: var(--theme-bg-hover) !important;
    color: var(--theme-footer-text) !important;
}

footer .social_btn a:hover {
    background: var(--theme-btn-accent-bg) !important;
    color: var(--theme-btn-accent-text) !important;
}

/* --- Icons inherit on hover --- */
.header_cart:hover icon,
.mobile_nav_close:hover icon,
#cart_button a icon {
    color: inherit !important;
}

/* --- Unified buttons (override default.css / style.css hovers) --- */
.ds_btn,
.ds_btn_primary,
a.ds_btn.ds_btn_primary,
.mobile_nav_cart,
#cart .container .button > a,
#cart .cart_total .button > a,
.crtok .ds_btn,
.crtok .button > a,
form input[type="submit"].ds_btn,
form input[type="submit"].ds_btn_primary {
    background: var(--theme-btn-primary-bg) !important;
    color: var(--theme-btn-primary-text) !important;
    border-color: transparent !important;
}

.ds_btn_primary:hover,
a.ds_btn.ds_btn_primary:hover,
.mobile_nav_cart:hover,
#cart .container .button > a:hover,
#cart .cart_total .button > a:hover,
.crtok .ds_btn:hover,
.crtok .button > a:hover,
form input[type="submit"].ds_btn:hover,
form input[type="submit"].ds_btn_primary:hover {
    background: var(--theme-btn-primary-hover-bg) !important;
    color: var(--theme-btn-primary-hover-text) !important;
    border-color: transparent !important;
}

#banner .banner_title {
    color: var(--theme-hero-text) !important;
}

#banner .banner_desc {
    color: var(--theme-text-on-media) !important;
}

#banner .banner_eyebrow {
    color: var(--theme-text-on-media-muted) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.ds_btn_accent,
.product_buy_add,
#banner .banner_cta,
.custom_order_card .banner_cta,
.header #tel_nav a {
    background: var(--theme-btn-accent-bg) !important;
    color: var(--theme-btn-accent-text) !important;
    border-color: transparent !important;
}

.product_photo_btn {
    background: var(--theme-bg-subtle) !important;
    color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.product_photo_btn:hover,
.product_photo_btn:focus-visible {
    background: var(--theme-bg-hover) !important;
    color: var(--theme-primary-dark) !important;
    border-color: var(--theme-primary-hover) !important;
}

.product_photo_btn:active {
    background: var(--theme-bg-active) !important;
}

.ds_btn_accent:hover,
.product_buy_add:hover,
#banner .banner_cta:hover,
.custom_order_card .banner_cta:hover,
.header #tel_nav a:hover {
    background: var(--theme-btn-accent-hover-bg) !important;
    color: var(--theme-btn-accent-hover-text) !important;
    border-color: transparent !important;
}

/* Dashed admin/catalog buttons */
.edit_btn,
.add_btn,
#product .section_header .add .add_btn,
#product section > .add a {
    background: transparent !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-text-link) !important;
}

.edit_btn:hover,
.add_btn:hover,
#product .section_header .add .add_btn:hover,
#product section > .add a:hover {
    background: var(--theme-primary) !important;
    color: var(--theme-btn-accent-text) !important;
    border-color: var(--theme-primary) !important;
}

/* Hamburger bars on hover / active */
.header .hmp:hover span,
.header .hmp:hover span::before,
.header .hmp:hover span::after,
.header .hmp.active span,
.header .hmp.active span::before,
.header .hmp.active span::after {
    background-color: var(--theme-btn-primary-text) !important;
}

/* --- Disabled buttons --- */
button:disabled,
input[type="submit"]:disabled,
.ds_btn:disabled {
    background: var(--theme-btn-disabled-bg) !important;
    color: var(--theme-btn-disabled-text) !important;
    cursor: not-allowed;
    transform: none !important;
}

/* --- Product page price (legacy .price) --- */
#product_item .price {
    color: var(--theme-text-price-sale) !important;
}

/* --- Legacy catalog items (non-card) --- */
#product .list .item:not(.product_card) .name,
#product .list .item:not(.product_card) .name a,
#product .list .item:not(.product_card) .price {
    color: var(--theme-text) !important;
}

#product .list .item:not(.product_card) .desc,
#product .list .item:not(.product_card) .tags li {
    color: var(--theme-text-muted) !important;
}

#product .list .item:not(.product_card) .tags li {
    background-color: var(--theme-badge-tag-bg) !important;
}

#product .list .item:not(.product_card).sale .price {
    color: var(--theme-text-price-sale) !important;
}

/* --- Header menu links --- */
.header #menu a {
    color: var(--theme-text) !important;
}

.header #menu a:hover,
.header #menu li:hover a {
    background-color: var(--theme-nav-hover) !important;
    color: var(--theme-primary) !important;
}

.pagination a {
    color: var(--theme-text) !important;
    background-color: var(--theme-card-bg) !important;
}

.pagination a:hover {
    background-color: var(--theme-nav-hover) !important;
    color: var(--theme-primary) !important;
}

.pagination .active a,
.pagination .active a:hover {
    background-color: var(--theme-primary) !important;
    color: var(--theme-btn-accent-text) !important;
}

/* --- Messages --- */
.msg_head {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-inverse) !important;
}

.msg_head p {
    color: var(--theme-text-inverse) !important;
}

/* --- Gallery overlay --- */
body.gallery_overlay_open .gallery_overlay {
    background: var(--theme-bg-overlay) !important;
}
