/*
 * Grant Wheels Custom Menu — Stylesheet
 * Plugin: Grant Wheels Custom Menu
 * Author: FullSparkLabs
 */

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
    --gwcm-ink:      #1a1a1a;
    --gwcm-ash:      #6b6b6b;
    --gwcm-paper:    #faf8f5;
    --gwcm-rule:     #e0d8ce;
    --gwcm-accent:   #c0392b;
    --gwcm-white:    #ffffff;
    --gwcm-drawer-w: 320px;
}

/* ============================================================
   Wrapper
   ============================================================ */
.gwcm-wrap {
    background: var(--gwcm-white);
    border-bottom: 3px solid var(--gwcm-ink);
    padding: 0 40px;
    position: relative;
    font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================================
   Desktop Nav
   ============================================================ */
.gwcm-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.gwcm-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.gwcm-list li a {
    font-size: 0.77rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gwcm-ink);
    text-decoration: none;
    position: relative;
    padding-bottom: 3px;
    transition: color 0.2s ease;
}

.gwcm-list li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--gwcm-accent);
    transition: width 0.25s ease;
}

.gwcm-list li a:hover {
    color: var(--gwcm-accent);
}
.gwcm-list li a:hover::after {
    width: 100%;
}

.gwcm-list li a.active {
    color: var(--gwcm-accent);
}
.gwcm-list li a.active::after {
    width: 100%;
}

/* ============================================================
   Hamburger Button
   ============================================================ */
.gwcm-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}

.gwcm-burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gwcm-ink);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
    transform-origin: center;
}

/* Animated X state */
.gwcm-burger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.gwcm-burger.is-open span:nth-child(2) {
    opacity: 0;
    width: 0;
}
.gwcm-burger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   Overlay
   ============================================================ */
.gwcm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.55);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.gwcm-overlay.is-visible {
    display: block;
}
.gwcm-overlay.is-open {
    opacity: 1;
}

/* ============================================================
   Mobile Drawer
   ============================================================ */
.gwcm-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--gwcm-drawer-w);
    max-width: 88vw;
    height: 100dvh;
    background: var(--gwcm-white);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.gwcm-drawer.is-open {
    transform: translateX(0);
}

/* Drawer Head */
.gwcm-drawer-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gwcm-rule);
    flex-shrink: 0;
}

/* Close Button */
.gwcm-close {
    background: none;
    border: 1.5px solid var(--gwcm-rule);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gwcm-ink);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.gwcm-close:hover {
    background: var(--gwcm-accent);
    border-color: var(--gwcm-accent);
    color: white;
}

/* Drawer List */
.gwcm-drawer-list {
    list-style: none;
    margin: 0;
    padding: 12px 0;
    flex: 1;
}

.gwcm-drawer-list li {
    opacity: 0;
    transform: translateX(18px);
    transition:
        opacity 0.3s ease calc(var(--i, 0) * 0.055s + 0.1s),
        transform 0.3s ease calc(var(--i, 0) * 0.055s + 0.1s);
}

.gwcm-drawer.is-open .gwcm-drawer-list li {
    opacity: 1;
    transform: translateX(0);
}

.gwcm-drawer-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gwcm-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--gwcm-rule);
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.2s ease;
    position: relative;
}

.gwcm-drawer-list li a::after {
    content: '→';
    font-size: 0.8rem;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gwcm-drawer-list li a:hover {
    background: var(--gwcm-paper);
    color: var(--gwcm-accent);
    padding-left: 34px;
}

.gwcm-drawer-list li a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.gwcm-drawer-list li a.active {
    color: var(--gwcm-accent);
    background: #fdf3f2;
    border-left: 3px solid var(--gwcm-accent);
}

/* ============================================================
   Responsive — tablet portrait and below (≤ 900px)
   ============================================================ */
@media (max-width: 991px) {
    .gwcm-wrap {
        padding: 0 20px;
    }
    .gwcm-meta {
        display: none;
    }
    .gwcm-list {
        display: none;
    }
    .gwcm-burger {
        display: flex;
    }
    .gwcm-nav {
        padding: 10px 0;
    }
}

@media (max-width: 480px) {
    .gwcm-wrap {
        padding: 0 16px;
    }
    .gwcm-logo {
        font-size: 1.5rem;
    }
}
