/* ============================================================
   DEXCALOR — Custom CSS
   Font: Montserrat (self-hosted)
   Primary: #004d80
   ============================================================ */

/* Self-hosted Montserrat font */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat/Montserrat-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat/Montserrat-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat/Montserrat-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat/Montserrat-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Root Variables */
:root {
    --color-primary: #004d80;
    --color-primary-dark: #003a60;
    --color-primary-light: #e8f2f9;
    --color-danger: #dc3545;
    --font-main: 'Poppins', sans-serif;
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    font-size: 15px;
    color: #1a1a1a;
    background-color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Top Bar */
.top-bar {
    background-color: #1a1a1a;
    font-size: 0.82rem;
}
.top-bar .container {
    flex-wrap: nowrap !important;
}
.top-menu {
    flex-wrap: nowrap !important;
}
.top-menu a {
    font-size: 0.82rem;
    white-space: nowrap;
}
.top-menu a:hover { opacity: 0.7; }

/* Header */
.main-header { border-bottom: 1px solid #e8e8e8; }
.logo-link img { transition: opacity 0.2s; }
.logo-link:hover img { opacity: 0.85; }

/* Search */
.search-container .form-control:focus { box-shadow: none; border-color: var(--color-primary); }

/* Header utils */
.header-utils a { transition: color 0.2s; }
.header-utils a:hover { color: var(--color-primary) !important; }
.cart-count { background-color: var(--color-primary) !important; }

/* Categories Nav */
.categories-nav {
    z-index: 100;
    border-bottom: 2px solid #f0f0f0;
}

/* ============================================================
   DEX MEGA MENU — Modern Dark Nav (Reference: irsap-grzejniki.pl)
   ============================================================ */
.dex-categories-nav {
    background: #ffffff;
    z-index: 200;
    position: sticky;
    top: 0;
    border-bottom: 1px solid #eaeaea;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

/* Nav inner wrapper */
.dex-nav-inner {
    display: flex;
    align-items: stretch;
}

/* Nav list */
.dex-nav-list {
    gap: 0;
}

/* Each nav item */
.dex-nav-item {
    position: relative;
    display: flex;
    align-items: stretch;
}

/* Main nav link */
.dex-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 52px;
    color: #333333 !important;
    text-decoration: none !important;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s, background 0.2s;
}
.dex-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 12px; right: 12px;
    height: 3px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}
/* Vertical separator between categories */
@media (min-width: 992px) {
    .dex-nav-item:not(:last-child) .dex-nav-link::before {
        content: "|";
        position: absolute;
        right: -3px;
        top: 50%;
        transform: translateY(-50%);
        color: #dddddd;
        font-weight: 300;
        font-size: 0.85rem;
    }
}
.dex-nav-item:hover .dex-nav-link,
.dex-nav-link.is-active {
    color: var(--color-primary) !important;
}
.dex-nav-item:hover .dex-nav-link::after,
.dex-nav-link.is-active::after {
    transform: scaleX(1);
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    left: 30px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none !important;
}
.whatsapp-float:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    color: #fff;
}
.whatsapp-float::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #25d366;
    opacity: 0.5;
    z-index: -1;
    animation: whatsapp-pulse 2s infinite;
}
@keyframes whatsapp-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Chevron icon */
.dex-chevron {
    opacity: 0.6;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.dex-nav-item:hover .dex-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Dropdown panel */
.dex-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-top: 3px solid var(--color-primary);
    z-index: 999;
    animation: dexFadeDown 0.18s ease;
}
@keyframes dexFadeDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dex-nav-item:hover .dex-dropdown {
    display: block;
}
.dex-dropdown-inner {
    padding: 18px 0;
}
.dex-dropdown-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    padding: 0 20px 10px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
}
.dex-sub-list li { margin: 0; }
.dex-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: #2d3748;
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
}
.dex-sub-link svg { color: var(--color-primary); flex-shrink: 0; }
.dex-sub-link:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    padding-left: 26px;
}

/* Mobile toggle button */
.dex-hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    cursor: pointer;
}
.dex-hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #333;
    border-radius: 1px;
    transition: all 0.3s ease-in-out;
}
/* Animation when open */
#dexNavToggle.is-open .dex-hamburger-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
#dexNavToggle.is-open .dex-hamburger-icon span:nth-child(2) {
    opacity: 0;
}
#dexNavToggle.is-open .dex-hamburger-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav hidden by default */
@media (max-width: 991.98px) {
    .dex-categories-nav {
        position: sticky !important;
        top: 96px !important;
        z-index: 1050 !important;
        background: #ffffff;
        border-bottom: 1px solid #eaeaea;
    }
    .dex-nav-inner {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        flex-direction: column;
        border-bottom: 2px solid var(--color-primary);
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        z-index: 1060;
    }
    .dex-nav-inner.is-open {
        display: flex !important;
    }
    .dex-nav-list { flex-direction: column !important; }
    .dex-nav-item { flex-direction: column; align-items: flex-start; width: 100%; }
    .dex-nav-link { height: auto; padding: 14px 20px; width: 100%; border-bottom: 1px solid rgba(0,0,0,0.05); color: #333 !important; }
    .dex-nav-link::after { display: none; }
    .dex-nav-item:hover .dex-nav-link,
    .dex-nav-link.is-active {
        background: var(--color-primary-light);
        color: var(--color-primary) !important;
    }
    .dex-dropdown {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        border-top: none;
        border-left: 3px solid var(--color-primary);
        background: #fcfcfc;
        animation: none;
    }
    .dex-nav-item.sub-open .dex-dropdown { display: block; }
    .dex-dropdown-title { display: none; }
    .dex-sub-link { padding: 10px 28px; color: #444; }
    .dex-sub-link:hover { background: var(--color-primary-light); color: var(--color-primary); padding-left: 34px; }
}

/* Letter spacing utility */
.ls-wider { letter-spacing: 0.06em; }

/* Mobile quick links (visible only in mobile nav dropdown) */
.dex-mobile-quicklinks {
    display: flex;
    flex-wrap: wrap;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 16px;
    gap: 4px;
}
.dex-mobile-quicklinks a {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.dex-mobile-quicklinks a:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}



/* ============================================================
   HERO SLIDER
   ============================================================ */
.hero-slider { position: relative; overflow: hidden; }
.carousel-item {
    background-size: cover;
    background-position: center;
    height: calc(100vh - 150px);
    min-height: 500px;
    max-height: 700px;
}

/* ============================================================
   FEATURES SECTION
   ============================================================ */
.features-section { border-bottom: 1px solid #f0f0f0; }
.feature-icon-circle {
    width: 64px; height: 64px;
    background-color: #2ecc71;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.3s;
}
.feature-icon-circle img {
    filter: brightness(0) invert(1);
}
.feature-icon-circle:hover {
    background-color: #27ae60;
    transform: scale(1.08);
}
.feature-icon-circle:hover img { filter: brightness(0) invert(1); }

/* ============================================================
   PRODUCT CARDS
   ============================================================ */
.product-card {
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.3s, transform 0.3s;
    border-radius: 8px;
}
.product-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
    transform: translateY(-3px);
}
.product-img-wrap { min-height: 180px; overflow: hidden; }
.product-img-wrap img {
    transition: transform 0.4s ease;
    mix-blend-mode: multiply;
}
.product-card:hover .product-img-wrap img { transform: scale(1.04); }

.add-to-cart-btn {
    background-color: #2ecc71 !important;
    min-width: 60px;
    transition: background-color 0.2s;
    cursor: pointer;
}
.add-to-cart-btn:hover { background-color: #27ae60 !important; }

/* ============================================================
   CATEGORY BANNER
   ============================================================ */
.category-banner {
    background-size: cover;
    background-position: center;
    height: 460px;
    position: relative;
    overflow: hidden;
}
.category-banner .overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
}
.category-banner > div:last-child { position: relative; z-index: 2; }

/* ============================================================
   SIDEBAR FILTERS
   ============================================================ */
.filter-card { border-radius: 12px; }
.form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }
.form-range::-webkit-slider-thumb { background: var(--color-primary); }

@media (min-width: 992px) {
    .filter-card { position: sticky; top: 90px; }
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb-item + .breadcrumb-item::before { content: "›"; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}
.btn-outline-primary { color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline-primary:hover { background-color: var(--color-primary); border-color: var(--color-primary); }
.btn-dexcalor {
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    transition: background-color 0.2s, transform 0.2s;
}
.btn-dexcalor:hover { background-color: var(--color-primary-dark); color: #fff; transform: translateY(-1px); }

/* ============================================================
   PRODUCT DETAIL
   ============================================================ */
.thumbnail-box {
    transition: all 0.2s ease;
    border: 2px solid transparent !important;
    cursor: pointer;
}
.thumbnail-box:hover { border-color: #dee2e6 !important; }
.thumbnail-box.active-thumbnail { border-color: var(--color-primary) !important; }

/* ============================================================
   CART & CHECKOUT
   ============================================================ */
.cart-item-row { transition: background 0.2s; }
.cart-item-row:hover { background: #fafafa; }
.order-summary-card { background: #f8f9fa; border-radius: 16px; }

/* ============================================================
   ACCOUNT
   ============================================================ */
.account-sidebar .nav-link {
    font-weight: 500;
    border-radius: 8px;
    color: #444;
    transition: all 0.2s;
}
.account-sidebar .nav-link:hover,
.account-sidebar .nav-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-links a:hover { color: #fff !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .carousel-item { height: auto; min-height: 420px; padding: 40px 0; }
    
    .hero-slider .display-3 {
        font-size: 2rem !important;
        margin-bottom: 0.8rem !important;
        line-height: 1.2;
    }
    .hero-slider .lead {
        font-size: 1rem !important;
        margin-bottom: 1.2rem !important;
    }
    .hero-slider .btn-lg {
        padding: 10px 24px !important;
        font-size: 0.95rem !important;
    }

    /* Category banner on mobile: shorter, show text inside it with interactive expand */
    .category-banner { height: auto; min-height: 160px; padding: 20px 0; }
    .category-banner .banner-text {
        display: block !important;
        margin-top: 0;
        padding: 0 15px;
    }
    .category-banner .banner-text h2 {
        font-size: 1.4rem !important;
        margin-bottom: 4px !important;
    }
    .category-banner .banner-text p {
        font-size: 0.8rem !important;
        margin-bottom: 0 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    .category-banner .banner-text p.expanded {
        display: block !important;
        overflow: visible;
        max-height: none;
    }
    .category-banner .banner-text p.can-expand {
        cursor: pointer;
    }
    .category-banner .banner-text p.can-expand::after {
        content: " (mai mult...)";
        font-weight: 600;
        color: #ffcccc;
        display: inline-block;
        margin-left: 5px;
    }
    .category-banner .banner-text p.can-expand.expanded::after {
        content: " (mai puțin)";
    }
    /* Top bar: hide links, show only phone */
    .top-bar .container { justify-content: center !important; }
    .top-bar .top-menu { display: none !important; }
    .top-bar .top-contact { font-size: 0.82rem; width: 100%; text-align: center; }

    /* Header logo smaller and absolutely centered */
    .main-header .d-flex {
        position: relative;
    }
    .logo-link {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 5;
    }
    .logo-link img { height: 42px !important; }

    /* Home category section: no negative overlap on mobile */
    .home-category-grid { margin-top: 0 !important; padding-top: 16px; }

    /* Product card adjustments on mobile */
    .product-info .add-to-cart-btn {
        width: 48px !important;
        min-height: 60px !important;
    }
    .product-info .add-to-cart-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    .product-info .add-to-cart-btn span {
        font-size: 0.55rem !important;
    }
    .product-info > div.p-3 {
        padding: 0.5rem !important; /* reduce padding */
    }
    .product-info span.fw-bold {
        font-size: 0.78rem !important;
        white-space: normal !important;
        text-overflow: clip !important;
        overflow: visible !important;
        display: block !important;
        min-height: auto !important;
        line-height: 1.4 !important;
        -webkit-line-clamp: unset !important;
    }
    .product-info .mt-1 span {
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }
    .product-img-wrap img {
        height: 130px !important;
        object-fit: contain !important;
        transform: scale(1.1) !important;
        transition: transform 0.4s ease !important;
    }
    .product-img-wrap {
        min-height: 130px !important;
        max-height: 130px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
    }
    .product-card:hover .product-img-wrap img {
        transform: scale(1.15) !important;
    }
}

@media (min-width: 992px) {
    /* Desktop/tablet: restore the pull-up effect for home category grid */
    .home-category-grid { margin-top: -140px; }
    .category-banner { height: 460px; }
    .category-banner .banner-text { margin-top: -80px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeInUp 0.5s ease forwards; }

/* ============================================================
   FORM STYLING
   ============================================================ */
.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(0,77,128,0.15);
}

/* Price badge */
.promo-badge {
    background: var(--color-danger);
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Pagination */
.pagination .page-item.active .page-link {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.pagination .page-link { color: var(--color-primary); }
.pagination .page-link:hover { color: var(--color-primary-dark); }

/* Status badges */
.badge-status-noua        { background-color: #0d6efd; color: #fff; }
.badge-status-in_procesare { background-color: #fd7e14; color: #fff; }
.badge-status-expediata   { background-color: #0dcaf0; color: #000; }
.badge-status-livrata     { background-color: #198754; color: #fff; }
.badge-status-anulata     { background-color: #dc3545; color: #fff; }

/* Custom connection icons and hover scaling */
.connection-icon-wrap svg {
    width: 100%;
    height: 100%;
    max-width: 40px;
    max-height: 40px;
}
.hover-scale {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-scale:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}
.cursor-pointer {
    cursor: pointer;
}

/* Lightbox navigation buttons */
.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 2rem;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    z-index: 1060;
}
.lightbox-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.1);
    color: #fff;
}
.lightbox-prev {
    left: -70px;
}
.lightbox-next {
    right: -70px;
}

@media (max-width: 991px) {
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

.btn-add-to-cart {
    background-color: #2ecc71 !important;
    border-color: #2ecc71 !important;
    color: #ffffff !important;
    transition: background-color 0.2s, border-color 0.2s;
}
.btn-add-to-cart:hover {
    background-color: #27ae60 !important;
    border-color: #27ae60 !important;
}

/* Navigation arrows for main product image view */
.main-gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.main-gallery-btn:hover {
    background: #00a69c;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    border-color: #00a69c;
}
.main-gallery-prev {
    left: 15px;
}
.main-gallery-next {
    right: 15px;
}
@media (max-width: 576px) {
    .main-gallery-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

/* Product main image and thumbnails layout */
.main-product-img-container {
    min-height: 500px;
}
@media (max-width: 991.98px) {
    .main-product-img-container {
        min-height: 350px !important;
    }
    .dex-thumbnail-container {
        max-height: 350px !important;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 2px;
    }
    .dex-thumbnail-container::-webkit-scrollbar {
        width: 3px;
    }
    .dex-thumbnail-container::-webkit-scrollbar-track {
        background: rgba(0,0,0,0.05);
    }
    .dex-thumbnail-container::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.2);
        border-radius: 10px;
    }
}

/* Custom thumbnail image and catalog button adjustments */
.thumbnail-img {
    height: 70px;
    object-fit: contain;
    mix-blend-mode: multiply;
    width: 100%;
}
.btn-catalog {
    font-size: 0.85rem;
}
@media (max-width: 991.98px) {
    .thumbnail-img {
        height: 50px;
    }
}
@media (max-width: 576px) {
    .btn-catalog {
        font-size: 0.72rem !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
        gap: 4px !important;
    }
    .btn-catalog svg {
        width: 14px !important;
        height: 14px !important;
    }
}






