body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f3f4f6;
    color: #374151;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

#added-to-cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #10b981;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: none;
    align-items: center;
}

#added-to-cart-notification content {
    border-right: 2px solid #ff8b00;
    padding-right: 11px;
    margin-right: 11px;
    font-size: 1.2em;
}

#callback-modal {
    /* (FIXED 2026-06-20) Removed `display: flex` from this rule. The modal's
     * own Tailwind classes (`fixed inset-0 ... flex items-center justify-center
     * hidden`) handle positioning + flex centering and let `.hidden` properly
     * hide it. With `display: flex` here (ID specificity 1,0,0) the rule beat
     * Tailwind's `.hidden` (0,1,0) and forced the modal visible on every page
     * load — original codebase masked this with `.hidden !important`, which in
     * turn broke `hidden md:block` for the filter sidebar and homepage hero.
     * Other props kept as extra polish (blur, overflow); they only apply when
     * .hidden is not present so the modal is being shown. */
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-width: 450px;
    width: 90%;
    position: relative;
    text-align: center;
}

.modal-content p {
    color: #3a4750;
    font-weight: 600;
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 10px;
}

.modal-content small {
    color: #838383;
    font-size: 15px;
    margin-top: 5px;
    margin-bottom: 25px;
    line-height: 1.4;
    display: block;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.close-button:hover {
    color: #1f2937;
}

#oppo {
    vertical-align: middle;
}

#callback-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#callback-form small {
    line-height: 1.2;
    color: #303030;
    font-weight: 500;
    font-size: 17px;
    text-align: left;
    display: flex;
    align-items: center;
}

#callback-form small content {
    color: #de6600;
    margin-left: 4px;
    font-size: 1.2em;
}

.ima1, .phone1, #callback-form input[type="text"], #callback-form input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.ima1:focus, .phone1:focus, #callback-form input[type="text"]:focus, #callback-form input[type="tel"]:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.tab {
    background-color: #f97316;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    margin-top: 10px;
}

.tab:hover {
    background-color: #ea580c;
    transform: translateY(-2px);
}

header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 40;
}

header img[src="img/logo.png"] {
    width: auto;
    height: 80px;
}

#myInput {
    padding: 8px 40px 8px 15px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 16px;
    width: 200px;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-sizing: border-box;
}

#myInput:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

header .fa-search {
    width: 20px;
    height: 20px;
}

.e {
    position: relative;
    display: inline-block;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: transparent;
    color: #374151;
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease-in-out;
}

.dropbtn:hover {
    color: #f97316;
}

.dropbtn sub img {
    vertical-align: middle;
    width: 20px;
    height: 20px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
    left: 0;
    top: 100%;
}

.dropdown-content p {
    padding: 10px 15px;
    margin: 0;
}

.dropdown-content a {
    color: #374151;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease-in-out;
}

.dropdown-content a:hover {
    background-color: #ddd;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.r1, .r2 {
    vertical-align: middle;
    width: 20px;
    height: 20px;
}

header div:nth-child(5) p {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease-in-out;
}

header div:nth-child(5) p a:hover {
    color: #f97316;
}

header div:nth-child(5) p sub img {
    vertical-align: middle;
    width: 20px;
    height: 20px;
}

#butt1 {
    background-color: #f97316;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#butt1:hover {
    background-color: #ea580c;
    transform: translateY(-2px);
}

.iot {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    background-color: transparent;
    border: none;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease-in-out;
}

.btn:hover {
    background-color: #f3f4f6;
}

.btn img {
    width: 28px;
    height: 28px;
    vertical-align: middle;
}

nav {
    background-color: #ffffff;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.k {
    position: relative;
}

.k4 {
    background-color: transparent;
    color: #374151;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    border-radius: 6px;
}

.k4:hover, .k4.active {
    color: #f97316;
    background-color: #fff7ed;
}

.k5, .k55 {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
    padding: 15px 0;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
}

.k:hover .k5, .k:hover .k55 {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

.k5 div {
    padding: 0 15px;
    box-sizing: border-box;
    min-width: 180px;
    margin-bottom: 15px;
}

.k5 div:last-child {
    margin-bottom: 0;
}

.k5 a {
    color: #374151;
    font-size: 15px;
    padding: 8px 0;
    display: block;
    transition: color 0.2s ease-in-out;
}

.k5 a:hover {
    color: #f97316;
}

.k5 a[style*="color: #de6600;"] {
    color: #f97316 !important;
    font-weight: 600;
    margin-top: 10px;
    font-size: 14px;
}

.k5 br {
    display: none;
}

.select {
    position: relative;
    display: inline-block;
    width: 100%;
}

#filter {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: white;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 16px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease-in-out;
}

#filter:hover, #filter:focus {
    border-color: #f97316;
}

#main {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

#wrapper1 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.item_box {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
}

.item_box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.lkjh1 {
    width: 100%;
    height: 220px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.iuow {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease-in-out;
}

.item_box:hover .iuow {
    transform: scale(1.05);
}

.iop {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.item_title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    min-height: 44px;
}

.pol {
    font-size: 16px;
    color: #4b5563;
    margin-bottom: 15px;
    font-weight: 500;
}

.item_price {
    font-size: 20px;
    font-weight: 700;
    color: #f97316;
}

.add_item {
    background-color: #3b82f6;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    width: 100%;
}

.add_item:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

#toTop {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f97316;
    color: white;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 25px;
    right: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease-in-out, opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
    z-index: 30;
    opacity: 0;
    visibility: hidden;
}

#toTop.show {
    opacity: 1;
    visibility: visible;
}

#toTop:hover {
    background-color: #ea580c;
    transform: translateY(-2px);
}

footer.lll {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 30px 20px;
    text-align: center;
    margin-top: 50px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

footer.lll sub {
    font-size: 14px;
    color: #d1d5db;
    padding: 15px 0;
    border-top: 1px solid #4b5563;
    width: 100%;
    display: block;
}

footer.lll .dropbtn {
    background-color: transparent;
    color: white;
    padding: 8px 15px;
    font-size: 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease-in-out;
}

footer.lll .dropbtn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

footer.lll p {
    padding-top: 0;
    padding-left: 0;
    margin-bottom: 0;
}

footer.lll p a {
    color: #f3f4f6;
    font-size: 12px;
    transition: color 0.2s ease-in-out;
}

footer.lll p a:hover {
    color: #f97316;
}

iframe {
    width: 100%;
    max-width: 950px;
    height: 300px;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    iframe {
        height: 200px;
    }
    #main-nav { display: none !important; }
    #mobile-menu-toggle { display: block !important; }
    .sidebar { display: none !important; }
    .main-content { width: 100% !important; }

    /* #mobile-menu / #mobile-menu-close: the panel is now fully owned by
       the Tailwind markup + JS in header.php (w-[85%] max-w-sm, z-50,
       translate-x-full toggling). This old fixed-width/z-999/
       translate-x-0 block predates that redesign — its ID-selector rules
       beat the Tailwind utility classes on specificity (70% width
       instead of 85%, z-999 instead of z-50, and a `.translate-x-0`
       class the current JS never even adds) and were left fighting the
       new markup. Removed; do not re-add per-page #mobile-menu rules
       here — the canonical styling lives in header.php. */
}

.product-card {
    display: flex;
    flex-direction: column;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* У вашому style.css або в тегу <style> */

.loading-spinner {
    position: fixed; /* Фіксоване положення на екрані */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Напівпрозорий білий фон */
    display: flex; /* Для центрування спінера */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Щоб спінер був поверх усього */
    transition: opacity 0.5s ease; /* Для плавного зникнення */
}

.loading-spinner.hidden {
    opacity: 0;
    pointer-events: none; /* Дозволяє клікам проходити крізь невидимий елемент */
}

.spinner {
    border: 8px solid #f3f3f3; /* Світло-сірий фон */
    border-top: 8px solid #3498db; /* Синя верхня межа (обертається) */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite; /* Анімація обертання */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Клас для повного приховування елементів.
 * (FIXED 2026-06-20) Removed !important. Tailwind ships its own .hidden
 * utility (display: none, no !important) and templates use the
 * `hidden md:block` pattern to hide on mobile + show on desktop. With
 * !important here, this rule won against Tailwind's `.md:block`, so the
 * desktop filter sidebar (and the homepage hero) stayed hidden after
 * P4B started linking this stylesheet on the homepage. */
/* ============================================================
 * P4B (2026-06-20) — moved out of index.php's inline <style>.
 * ============================================================ */

/* Browser polyfill stub: tells layout engines that <img sizes="auto"> should
 * reserve intrinsic size proportional to 3000x1500 until the real dimensions
 * are known. Prevents CLS on the hero image grid. Was inline on index.php
 * line 12. Harmless to apply sitewide. */
img:is([sizes="auto" i], [sizes^="auto," i]) {
    contain-intrinsic-size: 3000px 1500px;
}

/* Mobile-menu layering fix.
 * Bug: the floating "Контакти" pill (#contact-toggle-btn / #social-contact-icons)
 *      lives at z-index 10001 (header.php). The mobile menu wrapper had z-50,
 *      so when the menu opened it sat under the pill on small viewports.
 * Old inline hack: `.p-6 { z-index: 9999 !important; position: relative; }`
 *                  applied to EVERY .p-6 element sitewide — way over-broad
 *                  (product cards, modal bodies, etc. also use p-6).
 * Real fix: scope the lift to the mobile menu's inner wrapper ONLY. Same z
 *           level (9999) the inline rule used, so visual stacking is unchanged. */
#mobile-menu > .p-6 {
    position: relative;
    z-index: 9999;
}

/* Filter modal trigger sits under the menu by design. */
#openFilterModalButton {
    z-index: 1 !important;
}

/* Make sure the interest modal's content doesn't get hidden by the floating
 * pagination/contact pill at the bottom of the viewport on mobile. */
#interestModal .bg-white {
    margin-bottom: 80px;
}

/* Cart count badge — shows the actual item count (owner reversed the
 * earlier "dot only" decision). The off-screen dummy .jqcart-total-cnt
 * span in header.php still has its own inline hidden styles, so it's
 * unaffected by this. The real, visible badge uses .cart-count-badge
 * (see header.php / ru/header.php for sizing/positioning). */
.jqcart-total-cnt.is-empty {
    display: none;
}
