<?php
/**
 * Storefront styles layered on top of the parent theme + Tailwind CDN.
 *
 * @package OfixbazeChild
 */

/* ---------------------------------------------------------------
 * Utilities
 * ------------------------------------------------------------- */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.ofix-home {
    overflow: hidden;
}

/* ---------------------------------------------------------------
 * Hero slider
 * ------------------------------------------------------------- */
.ofix-hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.55s ease;
}
.ofix-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

/* Photo layer: a non-replaced box that stretches with the slide, so the
   image inside always covers the whole slide (no dark gap underneath). */
.ofix-hero-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.ofix-hero-media img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    object-position: center;
}
.ofix-dot-pattern {
    background-image: radial-gradient(#ffffff 1px, transparent 1px);
    background-size: 16px 16px;
}

/* ---------------------------------------------------------------
 * Product tabs
 * ------------------------------------------------------------- */
.ofix-tab {
    color: #64748b;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
}
.ofix-tab:hover {
    color: #0f172a;
}
.ofix-tab.is-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* ---------------------------------------------------------------
 * Product gallery
 * ------------------------------------------------------------- */
.ofix-thumb.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #dbeafe;
    opacity: 1;
}

/* ---------------------------------------------------------------
 * Rich text (product description)
 * ------------------------------------------------------------- */
.ofix-prose p {
    margin-bottom: 0.85rem;
}
.ofix-prose ul,
.ofix-prose ol {
    margin: 0.5rem 0 1rem 1.25rem;
}
.ofix-prose ul {
    list-style: disc;
}
.ofix-prose ol {
    list-style: decimal;
}
.ofix-prose li {
    margin-bottom: 0.35rem;
}
.ofix-prose h2,
.ofix-prose h3,
.ofix-prose h4 {
    font-weight: 800;
    color: #0f172a;
    margin: 1rem 0 0.5rem;
}
.ofix-prose a {
    color: #ea580c;
    text-decoration: underline;
}
.ofix-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
}
.ofix-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.ofix-prose table th,
.ofix-prose table td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    text-align: left;
}
.ofix-prose table th {
    background: #f8fafc;
}

/* ---------------------------------------------------------------
 * Default WooCommerce add-to-cart (variable products etc.)
 * ------------------------------------------------------------- */
.ofix-default-cart .cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.ofix-default-cart .quantity input {
    width: 4rem;
    padding: 0.65rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 700;
}
.ofix-default-cart .single_add_to_cart_button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    border: 0;
}
.ofix-default-cart .single_add_to_cart_button:hover {
    background: #ea580c;
}
.ofix-default-cart .variations {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}
.ofix-default-cart .variations th,
.ofix-default-cart .variations td {
    padding: 0.35rem 0.5rem;
    text-align: left;
}
.ofix-default-cart .variations select {
    padding: 0.45rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
}

/* Hide number input spinners in the quote quantity control. */
.ofix-cart-form input[type="number"]::-webkit-outer-spin-button,
.ofix-cart-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.ofix-cart-form input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ---------------------------------------------------------------
 * Wishlist (YITH)
 * ------------------------------------------------------------- */
.ofix-wishlist .yith-wcwl-add-to-wishlist {
    margin: 0;
}
.ofix-wishlist a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    background: #fff;
    text-decoration: none;
}
.ofix-wishlist a:hover {
    color: #e11d48;
    border-color: #fecdd3;
    background: #fff1f2;
}

/* ---------------------------------------------------------------
 * Reviews
 * ------------------------------------------------------------- */
.ofix-reviews #reviews {
    margin: 0;
}
.ofix-reviews #reviews h2,
.ofix-reviews .woocommerce-Reviews-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
}
.ofix-reviews ol.commentlist {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ofix-reviews ol.commentlist li {
    margin-bottom: 0.75rem;
}
.ofix-reviews .comment_container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
}
.ofix-reviews .comment_container img.avatar {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
}
.ofix-reviews .comment-text {
    flex: 1;
}
.ofix-reviews .star-rating {
    color: #f59e0b;
    font-size: 0.7rem;
}
.ofix-reviews #respond {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
}
.ofix-reviews #respond input[type="text"],
.ofix-reviews #respond input[type="email"],
.ofix-reviews #respond textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.8rem;
}
.ofix-reviews #respond input#submit {
    background: #2563eb;
    color: #fff;
    border: 0;
    border-radius: 0.75rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.ofix-reviews .woocommerce-noreviews {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 0.8rem;
    color: #475569;
}

/* ---------------------------------------------------------------
 * Authenticity modal
 * ------------------------------------------------------------- */
.ofix-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.ofix-modal[hidden] {
    display: none !important;
}
.ofix-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
}
.ofix-modal-dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}
.ofix-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    cursor: pointer;
}
.ofix-modal-close:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* ---------------------------------------------------------------
 * Elementor spacing
 * ------------------------------------------------------------- */
.ofix-elementor-section > .elementor-container {
    max-width: 100% !important;
}
.ofix-elementor-section .elementor-widget-container {
    margin: 0;
}
.ofix-elementor-section .elementor-widget:not(:last-child) {
    margin-bottom: 0;
}

/* ---------------------------------------------------------------
 * Header navigation (original ofixbaze.com hierarchy)
 * ------------------------------------------------------------- */
.ofix-nav-menu,
.ofix-nav-menu .ofix-dropdown {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ofix-nav-menu > .ofix-nav-item {
    position: relative;
}
.ofix-nav-menu .ofix-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 70;
}
.ofix-nav-menu > .ofix-nav-item:hover > .ofix-dropdown,
.ofix-nav-menu > .ofix-nav-item:focus-within > .ofix-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.ofix-nav-menu .ofix-dropdown .ofix-dropdown {
    left: 100%;
    top: -0.5rem;
}
.ofix-nav-menu .ofix-dropdown .ofix-dropdown-item:hover > .ofix-dropdown,
.ofix-nav-menu .ofix-dropdown .ofix-dropdown-item:focus-within > .ofix-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.ofix-nav-menu .ofix-dropdown-item > a {
    white-space: nowrap;
}
.ofix-nav-menu .ofix-nav-link {
    white-space: nowrap;
}

/* Mobile accordion */
.ofix-m-group > summary::-webkit-details-marker {
    display: none;
}
.ofix-m-group > summary {
    list-style: none;
}
.ofix-m-group[open] > summary > i {
    transform: rotate(180deg);
}

/* ---------------------------------------------------------------
 * Quote form / modal
 * ------------------------------------------------------------- */
.ofix-quote-dialog {
    max-width: 760px;
}
.ofix-quote-form .ofix-quote-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.ofix-quote-form .ofix-quote-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ---------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------- */
@media (max-width: 1023px) {
    /* Let the hero height follow the slide content instead of a fixed
       box, so nothing is clipped and there is no dead space under the
       last row of buttons on phones and tablets. */
    [data-ofix-hero] {
        min-height: 0 !important;
    }
    .ofix-nav-menu .ofix-dropdown {
        display: none;
    }

    [data-ofix-hero] .ofix-hero-slide {
        position: relative;
        inset: auto;
        display: none;
    }

    [data-ofix-hero] .ofix-hero-slide.is-active {
        display: block;
    }

    [data-ofix-hero] .ofix-hero-body {
        height: auto !important;
        min-height: 0 !important;
    }
}

/* ---------------------------------------------------------------
 * Full-width header, trust banner and footer
 * (removes the empty side gutters on wide screens)
 * ------------------------------------------------------------- */
#page > header .max-w-7xl,
#page > section.bg-white .max-w-7xl,
#page > footer .max-w-7xl {
    max-width: none;
    width: 100%;
    padding-left: clamp(1rem, 2.5vw, 2.5rem);
    padding-right: clamp(1rem, 2.5vw, 2.5rem);
}

/* ---------------------------------------------------------------
 * Product archive category panel
 * Desktop: always-open list. Mobile: a single compact accordion so
 * the category list no longer pushes the product grid off-screen.
 * ------------------------------------------------------------- */
.ofix-cat-card {
    overflow: hidden;
}

.ofix-cat-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    list-style: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ofix-cat-summary::-webkit-details-marker {
    display: none;
}

.ofix-cat-summary::marker {
    content: "";
}

.ofix-cat-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f172a;
}

.ofix-cat-total {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
}

.ofix-cat-chevron {
    color: #64748b;
    font-size: 11px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.ofix-cat-panel[open] .ofix-cat-chevron {
    transform: rotate(180deg);
}

.ofix-cat-body {
    padding: 0 20px 18px;
}

.ofix-cat-current {
    display: none;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 11px;
    font-weight: 700;
}

.ofix-cat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
}

.ofix-cat-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
    color: inherit;
    text-decoration: none;
    line-height: 1.35;
}

.ofix-cat-list li:last-child .ofix-cat-link {
    border-bottom: 0;
}

.ofix-cat-link.is-active {
    color: #ea580c;
}

.ofix-cat-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #c2410c;
    text-decoration: none;
}

.ofix-cat-all:hover {
    text-decoration: underline;
}

/* Mobile: compact collapsed panel with an internally scrolling list */
@media (max-width: 1023px) {
    .ofix-cat-card {
        border-radius: 16px;
    }

    .ofix-cat-summary {
        padding: 14px 16px;
        border-bottom: 1px solid #f1f5f9;
    }

    .ofix-cat-panel:not([open]) .ofix-cat-summary {
        border-bottom: 0;
    }

    .ofix-cat-body {
        padding: 12px 16px 16px;
    }

    .ofix-cat-current {
        display: inline-flex;
    }

    .ofix-cat-list {
        max-height: 42vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-right: 4px;
    }

    .ofix-cat-link {
        padding: 9px 0;
        font-size: 12.5px;
    }

    .ofix-cat-all {
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid #f1f5f9;
        width: 100%;
        justify-content: space-between;
    }
}

/* Desktop: keep the list expanded; the summary acts as a heading */
@media (min-width: 1024px) {
    .ofix-cat-summary {
        cursor: default;
        padding-bottom: 12px;
        border-bottom: 1px solid #f1f5f9;
    }

    .ofix-cat-chevron {
        display: none;
    }

    .ofix-cat-body {
        padding-top: 14px;
    }
}

/* ---------------------------------------------------------------
 * Uniform product & category media frames
 * Every card shows the same image box with the photo contained,
 * so mixed aspect ratios no longer look scattered.
 * ------------------------------------------------------------- */
.ofix-media-frame {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    height: clamp(150px, 18vw, 210px);
    background: #ffffff;
    overflow: hidden;
}

.ofix-media-frame--wide {
    height: clamp(130px, 16vw, 175px);
}

.ofix-media-frame--hero {
    height: clamp(280px, 30vw, 430px);
}

.ofix-media-frame > img,
.ofix-media-frame > img.ofix-media-img {
    position: absolute;
    top: 12px;
    left: 12px;
    width: calc(100% - 24px) !important;
    height: calc(100% - 24px) !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center;
    padding: 0;
    transition: transform 0.3s ease;
}

.group:hover .ofix-media-frame > img {
    transform: scale(1.05);
}

.ofix-media-frame .ofix-media-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

@media (max-width: 640px) {
    .ofix-media-frame {
        height: 190px;
    }

    .ofix-media-frame--wide {
        height: 150px;
    }

    .ofix-media-frame--hero {
        height: 260px;
    }
}

/* ---------------------------------------------------------------
 * Pagination (search results, blog index, generic archives)
 * ------------------------------------------------------------- */
.ofix-pagination .nav-links,
.ofix-pagination ul.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ofix-pagination .page-numbers,
.ofix-pagination ul.page-numbers li > a,
.ofix-pagination ul.page-numbers li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.ofix-pagination .page-numbers:hover,
.ofix-pagination ul.page-numbers li > a:hover {
    border-color: #fb923c;
    color: #ea580c;
}

.ofix-pagination .page-numbers.current,
.ofix-pagination ul.page-numbers li > span.current {
    background: #ea580c;
    border-color: #ea580c;
    color: #ffffff;
}

.ofix-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}


/* ---------------------------------------------------------------
 * WCAG 2.1 AA contrast upgrades
 * Tailwind's orange-600 (#ea580c) only reaches 3.5:1 against white,
 * which fails the 4.5:1 minimum for normal-size text. orange-700
 * (#c2410c) reaches 5.2:1 and keeps the brand hue.
 * ------------------------------------------------------------- */
.bg-orange-600 { background-color: #c2410c !important; }
.hover\:bg-orange-600:hover { background-color: #c2410c !important; }
.text-orange-600 { color: #c2410c !important; }
.hover\:text-orange-600:hover { color: #c2410c !important; }
.group:hover .group-hover\:text-orange-600 { color: #c2410c !important; }

/* Small print muted tones: slate-400 is only legible on the dark footer/nav,
 * so text on light surfaces uses slate-500+ (see templates). */
/* ---------------------------------------------------------------
 * Brand / client logo marquee
 * Two identical copies inside the track, so -50% loops seamlessly.
 * ------------------------------------------------------------- */
.ofix-marquee {
    position: relative;
    overflow: hidden;
    padding-block: 2px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}

.ofix-marquee__track {
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    animation: ofix-marquee-scroll 34s linear infinite;
    will-change: transform;
}

.ofix-marquee:hover .ofix-marquee__track,
.ofix-marquee:focus-within .ofix-marquee__track {
    animation-play-state: paused;
}

@keyframes ofix-marquee-scroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(calc(-50% - 6px), 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .ofix-marquee {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .ofix-marquee__track {
        animation: none;
    }
}

/* ---------------------------------------------------------------
 * Auto-sliding product carousels
 * ------------------------------------------------------------- */
.ofix-carousel-track {
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.ofix-carousel-item {
    scroll-snap-align: start;
}

@media (prefers-reduced-motion: reduce) {
    .ofix-carousel-track {
        scroll-behavior: auto;
    }
}

/* ----------------------------------------------
   Pre-footer promotional banner
   Full-bleed: no side gutters, no rounded corners.
   ---------------------------------------------- */
.ofix-footer-banner-section {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    line-height: 0;
}

.ofix-footer-banner {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    background-color: #ffffff;
}

.ofix-footer-banner img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
}

@media (max-width: 640px) {
    .ofix-footer-banner {
        aspect-ratio: 16 / 9;
    }

    .ofix-footer-banner img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: left center;
    }
}