/* ==========================================================================
   GAMEVERS MEGA MENU — SELF-CONTAINED CSS
   Replicated faithfully from style.css sections 03, 04, 11 and
   gv-label-frontend.css so this single file is sufficient.
   ========================================================================== */


/* ══════════════════════════════════════════════════════════════════════════
   01.  TOP-LEVEL NAV BAR  (.gv-mega-nav)
   ══════════════════════════════════════════════════════════════════════════ */

.gv-mega-nav {
  position: relative;
  z-index: 999;
}

.gv-mega-nav__list {
    display: flex;
    flex-direction: row;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2em;
}

.gv-mega-nav__list > li {
  position: relative;
}

.gv-mega-nav__item {
    position: relative;
    margin: 0;
    padding: 0;
}

/* ── Top-level link ────────────────────────────────────── */
.gv-mega-nav__link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.2em;
    padding: 0;
    font-size: 1em;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.gv-mega-nav__link:hover {
    color: #4be0ff;
}

.gv-mega-nav__link span {
    line-height: 1;
}

/* Active indicator on hover/open (handled by JS class .active) */
.gv-mega-nav__item.active > .gv-mega-nav__link,
.gv-mega-nav__item:hover > .gv-mega-nav__link {
    color: #4be0ff;
}

/* ── Top-level icon ───────────────────────────────────── */
.gv-mega-nav__icon {
    width: 1.2em;
    height: 1.2em;
    object-fit: contain;
    opacity: 0.9;
    flex-shrink: 0;
    transition: filter 0.2s ease;
}

/* Tint icons to purple on hover/active */
.gv-mega-nav__item:hover .gv-mega-nav__icon,
.gv-mega-nav__item.active .gv-mega-nav__icon {
    filter: brightness(0) saturate(100%) invert(78%) sepia(60%) saturate(500%) hue-rotate(160deg) brightness(105%);
}

/* ── Icon Hover Swap ─────────────────────────────────── */
.gv-mega-nav__link .gv-icon-hover {
    display: none;
}

/* Only swap icons if hover icon exists */
.gv-mega-nav__item:hover .gv-mega-nav__link.has-hover-icon .gv-icon-normal,
.gv-mega-nav__item.active .gv-mega-nav__link.has-hover-icon .gv-icon-normal {
    display: none;
}

.gv-mega-nav__item:hover .gv-mega-nav__link.has-hover-icon .gv-icon-hover,
.gv-mega-nav__item.active .gv-mega-nav__link.has-hover-icon .gv-icon-hover {
    display: inline-block;
}

/* Active state — soft pill highlight */
.gv-mega-nav__link {
    position: relative;
    transition: color 0.2s ease;
}

.gv-mega-nav__link::after {
    content: '';
    display: block;
    position: absolute;
    inset: -6px -14px;
    border-radius: 999px;
    background: rgba(75, 225, 255, 0);
    box-shadow: 0 0 12px 2px rgba(75, 224, 255, 0.15);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.gv-mega-nav__item.active .gv-mega-nav__link::after,
.gv-mega-nav__item:hover .gv-mega-nav__link::after {
    opacity: 1;
}


/* ══════════════════════════════════════════════════════════════════════════
   02.  DROPDOWN CONTAINER  (.gv-mega-dropdown)
         Polished Version: Glassmorphism + Transitions.
   ══════════════════════════════════════════════════════════════════════════ */

.gv-mega-dropdown {
    position: fixed;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 999;
    left: 0;
    width: 100%;
    border-radius: 0 0 16px 16px;
    border: 1px solid rgba(255, 255, 255, 0.125);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-color: rgba(17, 25, 40, 0.92);
    padding: 1em 2em;
    box-sizing: border-box;
    overflow: visible;
    height: auto;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.gv-mega-dropdown-inner {
    display: inline-flex;
    flex-direction: row;
    align-items: flex-start; /* Ensure menus define the height, products fit within it */
    max-width: calc(100vw - 40px);
    gap: 1em;
    overflow: hidden;
}

/* When no products, panel takes full width */
.gv-mega-dropdown-inner:not(.has-products) .gv-megamenu__panel {
    flex: 1;
    width: 100%;
}

/* When products exist, sidebar is fixed width */
.gv-mega-dropdown-inner.has-products .gv-megamenu__panel {
    flex: 1;
    min-width: 0;
}

.gv-mega-dropdown-inner .gv-megamenu__panel {
    display: block !important;
    opacity: 1 !important;
    animation: none !important;
    visibility: visible !important;
    overflow: hidden;
}

/* Glass background color variants */
.gv-mega-dropdown.gv-megamenu-bg {
    background-color: rgba(17, 25, 40, 0.5);
    background-image: radial-gradient(ellipse at top left, rgba(0, 210, 255, 0.08) 0%, transparent 60%);
}
.gv-mega-dropdown.gv-megamenu-bg1 {
    background-color: rgba(17, 25, 40, 0.5);
    background-image: radial-gradient(ellipse at top left, rgba(157, 72, 255, 0.08) 0%, transparent 60%);
}
.gv-mega-dropdown.gv-megamenu-bg2 {
    background-color: rgba(17, 25, 40, 0.5);
    background-image: radial-gradient(ellipse at top left, rgba(30, 80, 255, 0.06) 0%, transparent 60%);
}
.gv-mega-dropdown.gv-megamenu-bg3 {
    background-color: rgba(17, 25, 40, 0.5);
    background-image: radial-gradient(ellipse at top left, rgba(255, 30, 30, 0.06) 0%, transparent 60%);
}
.gv-mega-dropdown.gv-megamenu-bg4 {
    background-color: rgba(17, 25, 40, 0.5);
    background-image: radial-gradient(ellipse at top left, rgba(255, 49, 167, 0.06) 0%, transparent 60%);
}


/* ══════════════════════════════════════════════════════════════════════════
   03.  COLUMNS GRID  (.gv-megamenu__columns)
         Replicated from style.css Section 04
   ══════════════════════════════════════════════════════════════════════════ */

.gv-megamenu__columns {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1em 1.6em;
    width: auto;
    align-items: flex-start;
}

.gv-megamenu__col {
    flex: 0 0 auto;
    min-width: 10em;
    padding-bottom: 0;
}

.gv-megamenu__col-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.gv-megamenu__col-title:hover {
    color: #4be0ff;
}

.gv-megamenu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gv-megamenu__list li {
    margin: 0;
    padding: 0;
}

.gv-megamenu__list a {
    font-size: 13px;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    height: 1.5em;
    line-height: 1.3;
    white-space: nowrap;
    transition: color 0.2s ease, transform 0.2s ease;
}

.gv-megamenu__list a:hover {
    color: #ff31a7 !important;
    transform: translateX(3px);
}

.gv-megamenu__panel {
    width: 100%;
    overflow: hidden;
}

/* ── Icon ─────────────────────────────────────────────── */
.gv-megamenu__icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.25s ease;
}

.gv-megamenu__list a:hover .gv-megamenu__icon {
  opacity: 1;
}

/* ── Star icon (product auto-list) ────────────────────── */
.gv-mm-star {
    color: #ffffff;
    font-size: 18px;
    flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════════════════════
   04.  PRODUCT GRID & CARDS
         Replicated from style.css Section 03
   ══════════════════════════════════════════════════════════════════════════ */

.gv-category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.gv-cat-section {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.gv-cat-section-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  font-size: 14px;
}

.gv-cat-products {
    display: flex;
    flex-flow: column wrap;
    align-content: center;
    justify-content: center;
    gap: 12px;
    height: auto; /* Managed by JS updateProductLayout */
    width: auto;
    flex: 0 0 auto;
    overflow: visible;
}

/* ── Product Card ─────────────────────────────────────── */
.gv-prod-card {
    flex: 0 0 auto;
    width: 8.5em;
    aspect-ratio: 0.77; /* Matches 8.5/11 ratio */
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    animation: gvFadeSlide 0.3s ease forwards;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gv-prod-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.gv-prod-card:hover .gv-prod-thumb {
  transform: scale(1.05);
}

/* Image: 4:5 aspect ratio */
.gv-prod-thumb {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* ── Badge ────────────────────────────────────────────── */
.gv-prod-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* ── Product block wrapper ────────────────────────────── */
.gv-product-block-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    align-self: stretch;
    width: auto;
    min-width: 0;
    flex-shrink: 0;
    overflow: visible;
    margin-top: 0;
}


/* ══════════════════════════════════════════════════════════════════════════
   05.  LABEL BADGES  (.gv-label)
   ══════════════════════════════════════════════════════════════════════════ */

.gv-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    color: #ffffff;
    flex-shrink: 0;
}

/* Ensure labels inside product cards are positioned correctly and use standard shape */
.gv-prod-card .gv-label {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
    font-size: 0.6em !important;
    font-weight: 500;
    padding: 1px 3px;
    border-radius: 2px !important;
    transform: none !important;
    letter-spacing: -0.1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    line-height: 1;
}

.gv-label--hot       { background: #f40006; }
.gv-label--trending  { background: #9d48ff; }
.gv-label--popular   { background: #ff31a7; }
.gv-label--new       { background: #00b1ff; }


/* ══════════════════════════════════════════════════════════════════════════
   06.  PREVIEW IMAGE BOX
   ══════════════════════════════════════════════════════════════════════════ */

.gv-preview-box {
  position: fixed;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  z-index: 10000;
  display: none;
  pointer-events: none;
}

.gv-preview-box img {
  max-width: 280px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}


/* ══════════════════════════════════════════════════════════════════════════
   07.  RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .gv-megamenu__columns {
        flex-wrap: wrap;
    }
    .gv-mega-dropdown-inner .gv-product-block-wrapper {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Mobile: stack vertically */
    .gv-mega-nav__list {
        flex-direction: column;
        align-items: stretch;
    }

    .gv-mega-dropdown {
        position: static !important; /* Override JS fixed pos on mobile */
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .gv-megamenu__col {
        flex: 1 1 calc(50% - 16px);
    }
    
    .gv-mega-dropdown-inner {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .gv-megamenu__col {
        flex: 1 1 100%;
    }
}

@media (max-width: 300px) {
    .gv-prod-card {
        flex: 0 1 calc(33.33% - 16px) !important;
        max-width: calc(33.33% - 16px) !important;
    }
}
