/* ============================================
   DMB Mega Menu — Front Office Styles
   ============================================ */

/* ---- Base ---- */

.dmb-megamenu {
    width: 100%;
}

.dmb-megamenu__nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    height: 100%;
}

/* ---- Desktop nav item ---- */

.dmb-megamenu__nav-item {
    position: static;
    display: flex;
    align-items: center;
}

.dmb-megamenu__nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    color: var(--bs-body-color, #232323);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: color 0.2s ease;
    height: 100%;
}

.dmb-megamenu__nav-link:hover {
    color: var(--bs-primary, #24b9d7);
}

/* ---- Desktop dropdown panel ---- */

.dmb-megamenu__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100vw;
    background: #fff;
    border-top: 2px solid var(--bs-primary, #24b9d7);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    padding: 1.5rem 0;
}

.dmb-megamenu__nav-item:hover > .dmb-megamenu__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* ---- Columns ---- */

.dmb-megamenu__column {
    padding: 0 1rem;
    border-right: 1px solid #eee;
}

.dmb-megamenu__column:last-child {
    border-right: none;
}

/* ---- Item blocks ---- */

.dmb-megamenu__item {
    margin-bottom: 1rem;
}

.dmb-megamenu__item:last-child {
    margin-bottom: 0;
}

.dmb-megamenu__item-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #232323;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* HTML content block */
.dmb-megamenu__html {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #6c757d;
}

.dmb-megamenu__html a {
    color: var(--bs-primary, #24b9d7);
}

/* Product block — constrain the theme miniature inside the column */
.dmb-megamenu__product {
    max-width: 240px;
}

/* Image block */
.dmb-megamenu__image {
    line-height: 0;
    overflow: hidden;
}

.dmb-megamenu__image a {
    display: block;
}

.dmb-megamenu__image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dmb-megamenu__image:hover img {
    transform: scale(1.03);
}

/* ---- Category tree (desktop, recursive) ---- */

.dmb-megamenu__cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dmb-megamenu__cat-list--sub {
    padding-left: 1rem;
}

.dmb-megamenu__cat-item {
    margin: 0;
}

.dmb-megamenu__cat-link {
    display: block;
    padding: 0.25rem 0;
    color: #232323;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.dmb-megamenu__cat-link:hover {
    color: var(--bs-primary, #24b9d7);
}

.dmb-megamenu__cat-list--sub .dmb-megamenu__cat-link {
    color: #6c757d;
    font-size: 0.8125rem;
    padding: 0.1875rem 0;
}

.dmb-megamenu__cat-list--sub .dmb-megamenu__cat-link:hover {
    color: var(--bs-primary, #24b9d7);
}

/* ---- Desktop brand section — "Atelier Crème" ---- */

.dmb-megamenu__dropdown--brand {
    background: #faf8f4;
    border-top: 2px solid #c4a265;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    padding: 2rem 0 2.25rem;
}

/* Brand grid layout */
.dmb-brand__grid {
    display: grid;
    grid-template-columns: repeat(var(--dmb-brand-cols, 4), 1fr);
    gap: 1px;
    background: #ece7dd;
}

/* Brand card — shared base */
.dmb-brand__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.75rem 1.25rem;
    background: #fff;
    text-decoration: none;
    min-height: 100px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.dmb-megamenu__nav-item:hover .dmb-brand__card {
    animation: dmbBrandReveal 0.4s ease forwards;
    animation-delay: calc(min(var(--i, 0), 24) * 22ms);
}

.dmb-brand__card:hover {
    background: #f9f6f0;
    box-shadow: inset 0 0 0 1px rgba(196, 162, 101, 0.25);
}

@keyframes dmbBrandReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Brand card: Logo mode ---- */

.dmb-brand__logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    margin-bottom: 0.625rem;
}

.dmb-brand__logo {
    max-width: 100%;
    max-height: 56px;
    height: auto;
    object-fit: contain;
    filter: grayscale(40%) opacity(0.7);
    transition: filter 0.4s ease, transform 0.4s ease;
}

.dmb-brand__card:hover .dmb-brand__logo {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.06);
}

.dmb-brand__label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #b0a89a;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s, color 0.3s ease;
}

.dmb-brand__card:hover .dmb-brand__label {
    opacity: 1;
    transform: translateY(0);
    color: #9a7e3e;
}

/* ---- Brand card: Text-only mode ---- */

.dmb-brand__grid--text-only {
    gap: 0;
    background: transparent;
}

.dmb-brand__grid--text-only .dmb-brand__card {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    min-height: auto;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dmb-brand__grid--text-only .dmb-brand__card:hover {
    background: rgba(196, 162, 101, 0.06);
}

.dmb-brand__initial {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #c4a265;
    line-height: 1;
    width: 2rem;
    flex-shrink: 0;
    text-align: center;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.dmb-brand__card:hover .dmb-brand__initial {
    opacity: 1;
}

.dmb-brand__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #3d3a35;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
}

.dmb-brand__card:hover .dmb-brand__name {
    color: #9a7e3e;
}

/* Golden underline sweep */
.dmb-brand__sweep {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #c4a265, #d4b97a);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dmb-brand__card:hover .dmb-brand__sweep {
    transform: scaleX(1);
}


/* ============================================
   MOBILE — Accordion inside theme offcanvas
   ============================================ */

/* Force block layout on mobile (overrides d-flex / col-auto on wrapper) */
@media (max-width: 1199.98px) {
    .dmb-megamenu {
        display: block !important;
        width: 100% !important;
        flex: none !important;
    }
}

/* Smaller logo inside mobile offcanvas */
#mobileMenuCanvas .offcanvas-header .navbar-brand img,
#mobileMenuCanvas .offcanvas-header .logo {
    height: 20px;
    width: auto;
    max-width: 120px;
}

.dmb-mobile {
    width: 100%;
}

.dmb-mobile__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
}

.dmb-mobile__item {
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dmb-mobile__item:last-child {
    border-bottom: none;
}

.dmb-mobile__row {
    display: flex;
    align-items: center;
    width: 100%;
}

.dmb-mobile__link {
    display: block;
    flex: 1 1 0%;
    padding: 0.875rem 0;
    color: #232323;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
}

.dmb-mobile__link:hover,
.dmb-mobile__link:active {
    color: #232323;
    text-decoration: none;
}

/* Toggle button (chevron) */
.dmb-mobile__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #6c757d;
    -webkit-tap-highlight-color: transparent;
}

.dmb-mobile__toggle .material-icons {
    transition: transform 0.25s ease;
}

.dmb-mobile__item--open > .dmb-mobile__row > .dmb-mobile__toggle .material-icons {
    transform: rotate(180deg);
}

/* Submenu panel — collapsed by default */
.dmb-mobile__sub {
    display: none;
    padding: 0 0 0.75rem 0.5rem;
    width: 100%;
}

.dmb-mobile__item--open > .dmb-mobile__sub {
    display: block;
}

.dmb-mobile__item--open > .dmb-mobile__sub--brands {
    display: flex;
}

/* Sub links */
.dmb-mobile__sub-link {
    display: block;
    padding: 0.5rem 0;
    color: #232323;
    text-decoration: none;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dmb-mobile__sub-link:last-child {
    border-bottom: none;
}

.dmb-mobile__sub-link:hover {
    color: var(--bs-primary, #24b9d7);
    text-decoration: none;
}

/* Child category — indented */
.dmb-mobile__sub-link--child {
    padding-left: 1rem;
    color: #6c757d;
    font-size: 0.8125rem;
}

/* Brand pills (mobile) */
.dmb-mobile__sub--brands {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.5rem 0 1rem 0;
}

.dmb-mobile__brand-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: #f5f0e8;
    color: #3d3a35;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid rgba(196, 162, 101, 0.2);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dmb-mobile__brand-pill:hover,
.dmb-mobile__brand-pill:active {
    background: #3d3a35;
    border-color: #3d3a35;
    color: #f5f0e8;
    text-decoration: none;
}

/* Section title inside megamenu mobile sub */
.dmb-mobile__section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin: 0.5rem 0 0.375rem;
    padding-bottom: 0.25rem;
}

.dmb-mobile__section-title:first-child {
    margin-top: 0;
}

/* Image inside mobile sub */
.dmb-mobile__sub-image {
    padding: 0.5rem 0;
}

.dmb-mobile__sub-image img {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 0.375rem;
}

/* Product inside mobile sub */
.dmb-mobile__sub-product {
    padding: 0.5rem 0;
}

/* HTML inside mobile sub */
.dmb-mobile__sub-html {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6c757d;
    padding: 0.5rem 0;
}

/* ============================================
   Product page — Color variant image selectors
   ============================================ */

.dmb-color-variant__img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
}

.dmb-color-variant__img.active,
.dmb-color-variant input:checked + .dmb-color-variant__img {
    border-color: var(--bs-primary, #000);
}

/* ============================================
   Product miniature — Variant thumbnails
   ============================================ */

.pm__variant-thumb-link {
    display: inline-block;
    border-radius: 0.25rem;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    line-height: 0;
}

.pm__variant-thumb-link:hover {
    border-color: var(--bs-primary, #000);
}

.pm__variant-thumb-link .pm__variant-thumb {
    border-radius: 0.1875rem;
    object-fit: cover;
}
