/* ============================================================
   Staff login corner widget - top right of every page
   ============================================================ */
.staff-corner {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    gap: 8px;
}
.staff-btn {
    background: rgba(0, 0, 0, 0.65);
    color: var(--muted, #9aaccc);
    border: 1px solid var(--line, rgba(77, 163, 255, 0.18));
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.staff-btn:hover {
    color: var(--gold, #f5c518);
    border-color: rgba(245, 197, 24, 0.45);
}
@media (max-width: 480px) {
    .staff-corner { top: 8px; right: 8px; }
    .staff-btn { font-size: 10px; padding: 6px 10px; }
}

/* ============================================================
   Language switcher - top left of every page
   ============================================================ */
.lang-switch {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid var(--line, rgba(77, 163, 255, 0.18));
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(8px);
}
.lang-btn {
    border: none;
    background: transparent;
    color: var(--muted, #9aaccc);
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lang-btn.active {
    background: var(--gold, #f5c518);
    color: #111;
}
.lang-btn:hover:not(.active) {
    color: var(--gold, #f5c518);
}
@media (max-width: 480px) {
    .lang-switch { top: 8px; left: 8px; }
    .lang-btn { font-size: 10px; padding: 6px 10px; }
}

/* ============================================================
   Product grid + cards - category pages and the home page
   (rendered by js/products.js)
   ============================================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 20px;
}
.products-status {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted, #9aaccc);
    font-size: 16px;
    padding: 48px 0;
    margin: 0;
}
.product-card {
    background: var(--panel, #0d1a33);
    border: 1px solid var(--line, rgba(77, 163, 255, 0.18));
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
a.product-card { color: inherit; text-decoration: none; }
.product-view {
    display: block;
    margin-top: 10px;
    color: var(--gold, #f5c518);
    font-size: 0.85rem;
    font-weight: 600;
}
/* the card a home-page link pointed at (js/products.js focusLinkedProduct) */
.product-card.product-focus {
    border-color: var(--gold, #f5c518);
    animation: product-focus 1s ease 3;
}
@keyframes product-focus {
    50% { box-shadow: 0 0 0 4px rgba(245, 197, 24, 0.55); }
}
.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 197, 24, 0.45);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
}
.product-img-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: #070d1c;
    cursor: zoom-in;
    overflow: hidden;
}
.product-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.product-card:hover img { transform: scale(1.05); }
.product-card.out-of-stock img { filter: grayscale(0.85); opacity: 0.6; }
.product-img-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
}
.product-noimg {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
    background: #070d1c;
    color: var(--muted, #9aaccc);
    font-size: 13px;
}
.product-noimg span { font-size: 34px; opacity: .5; }

.product-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.product-body h3 {
    color: var(--text, #eaf3ff);
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-model {
    margin: -4px 0 0;
    color: var(--gold, #f5c518);
    font-size: 14px;
    font-weight: 600;
}
.product-color {
    margin: -4px 0 0;
    color: var(--muted, #9aaccc);
    font-size: 13px;
}
.product-size-badge {
    align-self: flex-start;
    background: rgba(245, 197, 24, 0.1);
    border: 1px solid rgba(245, 197, 24, 0.35);
    color: var(--gold, #f5c518);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
}
.product-desc {
    color: var(--muted, #9aaccc);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* "Read more": the whole name and description, line breaks as staff typed them */
.product-more {
    align-self: flex-start;
    padding: 0;
    border: none;
    background: none;
    color: var(--gold, #f5c518);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.product-more:hover { text-decoration: underline; }
.product-card.expanded h3,
.product-card.expanded .product-desc {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}
.product-card.expanded .product-desc { white-space: pre-line; overflow-wrap: anywhere; }
.product-card.expanded h3 { overflow-wrap: anywhere; }
.product-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.product-price {
    color: var(--gold, #f5c518);
    font-weight: 700;
    font-size: 20px;
}
.product-price.ask { font-size: 14px; color: var(--text, #eaf3ff); }
.product-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #4ade80;
    white-space: nowrap;
}
.product-stock::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.product-stock.stock-out { color: #ff7a7a; }

@media (max-width: 560px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-body { padding: 12px; gap: 6px; }
    .product-body h3 { font-size: 14px; }
    .product-desc { display: none; }
    .product-price { font-size: 16px; }
    .product-price.ask { font-size: 12px; }
    .product-footer { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 8px; }
}

/* ============================================================
   Lightbox - full-screen viewer (js/products.js)
   A swipeable strip of slides; a hint + dots show there's more.
   ============================================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.97);
    display: none;
    flex-direction: column;
}
.lightbox.open { display: flex; }
.lb-track {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 8px;
    box-sizing: border-box;
}
.lb-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
}
.lb-btn {
    position: absolute;
    z-index: 2;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 44px;
    padding: 0;
    cursor: pointer;
}
.lb-btn:hover { background: var(--gold, #f5c518); color: #111; }
.lb-close { top: 12px; right: 12px; }

/* "swipe for more" hint: nudges to the right until the first swipe */
.lb-hint {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
    animation: lbNudge 1.4s ease-in-out infinite;
    transition: opacity .3s;
}
.lb-hint-arrow { color: var(--gold, #f5c518); letter-spacing: -2px; }
@keyframes lbNudge {
    0%, 100% { transform: translate(0, -50%); }
    50% { transform: translate(8px, -50%); }
}
.lightbox.single .lb-hint,
.lightbox.swiped .lb-hint { opacity: 0; animation: none; }

.lb-footer { padding: 10px 16px 18px; text-align: center; }
.lb-caption { color: #ddd; font-size: 14px; min-height: 20px; }
.lb-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lb-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: width .25s, background .25s;
}
.lb-dots button.active { width: 26px; background: var(--gold, #f5c518); }
@media (max-width: 480px) {
    .lb-slide { padding: 56px 6px 6px; }
    .lb-btn { background: rgba(0, 0, 0, 0.55); }
    .lb-hint { right: 10px; font-size: 13px; }
}
