/* === NETCOORD SHOP storefront styles === */

:root {
    --netcoord-violet: #4A33FF;
    --deep-court-purple: #2D1E80;
    --electric-red: #FF3366;
    --match-green: #32D74B;
    --soft-white: #F8F9FF;
    --court-gray: #A9AFC5;
    --slate-shadow: #1B1B2A;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #14102e 0%, #1B1B2A 100%);
    color: var(--soft-white);
    min-height: 100vh;
}

/* ---- header ---- */

/* Sticky top bar that stays on screen: back button (left), NetCoord × Diadem
   marks (center, absolutely centered like the main page branding), cart (right).
   The title pill below it scrolls away. */
.shop-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    min-height: 64px;
    background: rgba(20, 16, 46, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-hero-logo-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    line-height: 0;
    pointer-events: none;
}
.shop-hero-logo {
    height: 46px;
    max-width: 56vw;
    width: auto;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.shop-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--soft-white);
    border-radius: 12px;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease;
    z-index: 1;
}
.shop-back-btn:hover { background: rgba(255, 255, 255, 0.16); }
.shop-back-btn .material-icons { font-size: 18px; }

.shop-topbar .shop-cart-button { z-index: 1; }

/* Title pill below the sticky bar — scrolls off-screen. */
.shop-title-bar {
    display: flex;
    justify-content: center;
    margin: 0 0 22px;
}
.shop-title-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    padding: 10px 26px;
}

/* Line 1 — the store name, two-tone. */
.shop-title-main {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.shop-title-netcoord { color: var(--electric-red); }
.shop-title-armory { color: var(--soft-white); }

/* Line 2 — equipment credit, with the Diadem brand picked out in their teal. */
.shop-title-sub {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.6px;
    color: var(--court-gray);
}
.shop-title-diadem {
    font-weight: 800;
    color: #1FC8BC;
}

@media (max-width: 520px) {
    .shop-hero-logo { height: 38px; max-width: 46vw; }
    .shop-back-text { display: none; }
    .shop-back-btn { padding: 8px 10px; }
    .shop-title-pill { padding: 8px 18px; }
    .shop-title-main { font-size: 18px; }
    .shop-title-sub { font-size: 12px; }
}

.shop-cart-button {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--soft-white);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.shop-cart-button:hover { background: rgba(255, 255, 255, 0.16); }

.shop-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--electric-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    padding: 0 5px;
}

/* ---- main ---- */

.shop-main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }

.shop-banner {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
}
.shop-banner.success { background: rgba(50, 215, 75, 0.15); border: 1px solid var(--match-green); color: #b6f5c4; }
.shop-banner.cancel { background: rgba(255, 51, 102, 0.12); border: 1px solid var(--electric-red); color: #ffc2d1; }

.shop-filters { margin-bottom: 22px; }
.shop-topfilters { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-subfilters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-filter {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--court-gray);
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.15s ease;
}
.shop-filter:hover { color: var(--soft-white); }
.shop-filter.active { background: var(--netcoord-violet); border-color: var(--netcoord-violet); color: #fff; }

/* Sub-filters are lighter/smaller than the top-level pills. */
.shop-subfilter {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--court-gray);
    padding: 5px 13px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}
.shop-subfilter:hover { color: var(--soft-white); }
.shop-subfilter.active { background: var(--electric-red); border-color: var(--electric-red); color: #fff; }

.shop-loading, .shop-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--court-gray);
    padding: 60px 20px;
    font-size: 16px;
}

/* ---- product grid ---- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.product-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); border-color: rgba(74, 51, 255, 0.5); }

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.03);
}
.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
}
.product-image-placeholder .material-icons { font-size: 64px; }

.product-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.product-brand {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--netcoord-violet);
    font-weight: 700;
}
.product-name { font-size: 16px; margin: 0; line-height: 1.3; }
.product-price { font-size: 20px; font-weight: 700; margin-top: auto; }

/* Vendor spec rows (shown in place of the old marketing description). */
.product-specs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12.5px;
    line-height: 1.35;
}
.product-specs li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.spec-label { color: var(--court-gray); white-space: nowrap; }
.spec-value { text-align: right; }

.product-variant {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--soft-white);
    font-size: 14px;
}
.product-variant option { background: #1B1B2A; }

.add-to-cart-button {
    background: var(--netcoord-violet);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 11px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.add-to-cart-button:hover { background: #5a45ff; }

/* ---- cart drawer ---- */

.cart-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 380px;
    max-width: 90vw;
    background: #191430;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 40;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cart-drawer-header h2 { margin: 0; font-size: 20px; }

.cart-close-button {
    background: none;
    border: none;
    color: var(--court-gray);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.cart-close-button:hover { color: var(--soft-white); }

.cart-items { flex: 1; overflow-y: auto; padding: 8px 20px; }

.cart-empty { text-align: center; color: var(--court-gray); padding: 40px 0; }

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cart-item-name { font-size: 14px; font-weight: 600; }
.cart-item-variant { font-size: 12px; color: var(--court-gray); }
.cart-item-price { font-size: 14px; color: var(--soft-white); margin-top: 2px; }

.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.qty-button {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: var(--soft-white);
    font-size: 16px;
    cursor: pointer;
}
.qty-button:hover { background: rgba(255, 255, 255, 0.14); }
.qty-value { min-width: 20px; text-align: center; font-weight: 600; }

.cart-footer { padding: 18px 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.cart-note { font-size: 12px; color: var(--court-gray); margin: 0 0 14px; }

.checkout-button {
    width: 100%;
    background: var(--match-green);
    color: #0c2914;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.checkout-button:hover:not(:disabled) { opacity: 0.9; }
.checkout-button:disabled { opacity: 0.4; cursor: not-allowed; }

.checkout-error { color: var(--electric-red); font-size: 13px; margin: 10px 0 0; text-align: center; }

@media (max-width: 520px) {
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .shop-main { padding: 18px 14px 40px; }
}
