/* ==========================================================================
   БудМатеріал - WooCommerce Theme Custom Stylesheet
   Color Palette:
   - Primary Accent: #FF6600 (Safety Orange)
   - Primary Hover:  #E65C00 (Darker Orange)
   - Dark Accent:    #121212 (Jet Black)
   - Card/Bar Dark:  #1E1E1E (Charcoal Dark)
   - Secondary Text: #6B7280 (Cool Muted Gray)
   - Background Light: #F8F9FA
   Font: 'Montserrat', sans-serif
   ========================================================================== */

:root {
    --bm-orange: #FF6600;
    --bm-orange-hover: #E65C00;
    --bm-orange-light: #FFF0E6;
    --bm-dark: #121212;
    --bm-dark-card: #1E1E1E;
    --bm-dark-hover: #2B2B2B;
    --bm-gray-bg: #F8F9FA;
    --bm-border-color: #E5E7EB;
    --bm-text-main: #1F2937;
    --bm-text-muted: #6B7280;
    --bm-font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: var(--bm-font-family);
    color: var(--bm-text-main);
    background-color: #FAFAFA;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   Typography & Utility Classes
   ========================================================================== */

h1, h2, h3, h4, h5, h6, .fw-title {
    font-family: var(--bm-font-family);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-orange {
    color: var(--bm-orange) !important;
}

.bg-orange {
    background-color: var(--bm-orange) !important;
    color: #FFFFFF !important;
}

.btn-orange {
    background-color: var(--bm-orange);
    color: #FFFFFF;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.6rem 1.4rem;
    transition: all 0.25s ease-in-out;
}

.btn-orange:hover, .btn-orange:focus {
    background-color: var(--bm-orange-hover);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.btn-outline-orange {
    border: 2px solid var(--bm-orange);
    color: var(--bm-orange);
    font-weight: 600;
    background: transparent;
    transition: all 0.25s ease-in-out;
}

.btn-outline-orange:hover {
    background-color: var(--bm-orange);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.25);
}

.btn-dark-custom {
    background-color: var(--bm-dark);
    color: #FFFFFF;
    font-weight: 600;
    border: none;
    transition: all 0.25s ease-in-out;
}

.btn-dark-custom:hover {
    background-color: var(--bm-dark-hover);
    color: var(--bm-orange);
}

.hover-orange:hover {
    color: var(--bm-orange) !important;
    transition: color 0.2s ease;
}

.hover-shadow:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* ==========================================================================
   Header & Top Bar
   ========================================================================== */

.top-bar {
    background-color: var(--bm-dark);
    color: #D1D5DB;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-header {
    background-color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.header-search-input {
    border: 2px solid var(--bm-dark);
    border-radius: 4px 0 0 4px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
}

.header-search-input:focus {
    box-shadow: none;
    border-color: var(--bm-orange);
}

.header-search-btn {
    background-color: var(--bm-orange);
    border: 2px solid var(--bm-orange);
    color: #FFFFFF;
    border-radius: 0 4px 4px 0;
    padding: 0 1.5rem;
    font-weight: 600;
}

.header-icon-box {
    position: relative;
    color: var(--bm-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.header-icon-box .badge-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background-color: var(--bm-orange);
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Full-Width Mega Menu (Повноширинне Мега Меню)
   ========================================================================== */

.navbar-mega-bar {
    background-color: var(--bm-dark);
    position: relative;
    z-index: 1020;
    border-bottom: 3px solid var(--bm-orange);
}

.navbar-mega-bar .nav-link {
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    transition: color 0.2s ease;
}

/* Mega menu full width dropdown logic */
.mega-dropdown-item {
    position: static !important;
}

.mega-menu-dropdown {
    width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 0 !important;
    border-top: 3px solid var(--bm-orange) !important;
    border-radius: 0 !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
    animation: fadeInDown 0.25s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-menu-category-card {
    transition: transform 0.2s ease;
}

.mega-menu-category-card:hover {
    transform: translateY(-2px);
}

/* ==========================================================================
   Homepage Slider & Banners
   ========================================================================== */

.hero-slider-item {
    min-height: 420px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.hero-slider-overlay {
    background: linear-gradient(90deg, rgba(18, 18, 18, 0.9) 0%, rgba(18, 18, 18, 0.4) 70%, rgba(18, 18, 18, 0) 100%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 3rem;
}

.promo-badge {
    background-color: var(--bm-orange);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    display: inline-block;
}

/* ==========================================================================
   Product Card Component (WooCommerce Grid - 3 per row on desktop)
   ========================================================================== */

.product-card {
    background: #FFFFFF;
    border: 1px solid var(--bm-border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    border-color: var(--bm-orange);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.product-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card-img-wrap {
    position: relative;
    padding-top: 80%; /* 4:3 aspect ratio */
    overflow: hidden;
    background-color: #F9FAFB;
}

.product-card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-img-wrap img {
    transform: scale(1.06);
}

.product-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--bm-text-muted);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7em;
}

.product-card-title a {
    color: var(--bm-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card-title a:hover {
    color: var(--bm-orange);
}

.product-rating {
    color: #F59E0B;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.product-price-box {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--bm-dark);
}

.price-old {
    font-size: 0.9rem;
    color: #9CA3AF;
    text-decoration: line-through;
}

.product-card-footer {
    padding: 0 1.25rem 1.25rem 1.25rem;
    display: flex;
    gap: 0.5rem;
}

/* ==========================================================================
   Category Archive Sidebar Filters
   ========================================================================== */

.filter-sidebar {
    background-color: #FFFFFF;
    border: 1px solid var(--bm-border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bm-orange);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-group-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: var(--bm-dark);
}

.custom-checkbox .form-check-input:checked {
    background-color: var(--bm-orange);
    border-color: var(--bm-orange);
}

/* ==========================================================================
   Single Product Detail Page
   ========================================================================== */

.single-product-gallery-main {
    border: 1px solid var(--bm-border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: #FFFFFF;
    margin-bottom: 1rem;
    position: relative;
    padding-top: 75%;
}

.single-product-gallery-main img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1.5rem;
}

.single-product-thumb {
    width: 80px;
    height: 80px;
    border: 2px solid var(--bm-border-color);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}

.single-product-thumb.active, .single-product-thumb:hover {
    border-color: var(--bm-orange);
}

.single-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stock-badge-in {
    background-color: #D1FAE5;
    color: #065F46;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.stock-badge-out {
    background-color: #FEE2E2;
    color: #991B1B;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 2px solid var(--bm-dark);
    border-radius: 4px;
    width: 130px;
}

.qty-control button {
    border: none;
    background: transparent;
    width: 38px;
    height: 38px;
    font-weight: 700;
    font-size: 1.1rem;
}

.qty-control input {
    width: 50px;
    border: none;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
}

.qty-control input:focus {
    outline: none;
}

/* Product Tabs */
.product-info-tabs .nav-link {
    font-weight: 700;
    text-transform: uppercase;
    color: var(--bm-dark);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
}

.product-info-tabs .nav-link.active {
    color: var(--bm-orange);
    border-bottom-color: var(--bm-orange);
    background: transparent;
}

/* Specs Table */
.table-specs tr:nth-child(even) {
    background-color: #F9FAFB;
}

.table-specs td {
    padding: 0.85rem 1rem;
}

/* Footer */
footer {
    background-color: var(--bm-dark);
    color: #9CA3AF;
    font-size: 0.9rem;
}

footer h5, footer h6 {
    color: #FFFFFF;
}

footer a {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--bm-orange);
}
