
/* =====================================================
   Legendcy Headless Tebex Store
===================================================== */

.store-page {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    background:
        radial-gradient(circle at 15% 10%, rgba(255,106,26,.12), transparent 35%),
        radial-gradient(circle at 85% 20%, rgba(79,209,197,.07), transparent 30%),
        var(--bg-void);
    padding-bottom: 90px;
}

.store-hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 90px 24px 55px;
    text-align: center;
}

.store-hero h1 {
    margin: 0;
    font-family: 'Fraunces', serif;
    font-size: clamp(42px, 6vw, 72px);
    color: var(--ivory);
}

.store-hero p {
    max-width: 650px;
    margin: 18px auto 0;
    color: var(--muted);
    line-height: 1.7;
}

.store-layout {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
}

.store-main {
    min-width: 0;
}

.store-toolbar,
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 24px;
}

.store-toolbar h2,
.cart-header h2 {
    margin: 3px 0 0;
    font-family: 'Fraunces', serif;
    font-size: 30px;
    color: var(--ivory);
}

.toolbar-label {
    color: var(--brand-gold);
    font: 11px 'JetBrains Mono', monospace;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.cart-button,
.checkout-button {
    border: 0;
    cursor: pointer;
    font: 600 14px 'Inter', sans-serif;
    border-radius: 9px;
}

.cart-button {
    padding: 11px 16px;
    background: var(--bg-panel-2);
    color: var(--ivory);
    border: 1px solid rgba(255,255,255,.12);
}

.cart-button span {
    display: inline-flex;
    min-width: 23px;
    height: 23px;
    margin-left: 7px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-orange);
    color: #160b03;
    font-size: 12px;
}

.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.category-tab {
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,.05);
    color: var(--muted);
    border: 1px solid rgba(255,255,255,.08);
    cursor: pointer;
}

.category-tab.active,
.category-tab:hover {
    color: #171006;
    background: var(--brand-gold);
    border-color: var(--brand-gold);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.product-card {
    background: linear-gradient(145deg, rgba(31,36,43,.96), rgba(23,26,31,.96));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 22px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, border-color .18s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,180,84,.38);
}

.product-card-image {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 16px;
    background: rgba(0,0,0,.18);
}

.product-card h3 {
    margin: 0 0 8px;
    font-family: 'Fraunces', serif;
    color: var(--ivory);
    font-size: 21px;
}

.product-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 18px;
    flex: 1;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.product-price {
    color: var(--brand-gold);
    font-weight: 700;
    font-size: 17px;
}

.add-product {
    border: 0;
    border-radius: 8px;
    padding: 10px 13px;
    background: var(--brand-orange);
    color: #170a02;
    font-weight: 700;
    cursor: pointer;
}

.add-product:hover {
    background: var(--brand-gold);
}

.store-status {
    color: var(--muted);
    margin-bottom: 20px;
}


.purchase-mode{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:0 0 14px;padding:4px;border-radius:10px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}
.purchase-mode-btn{border:0;border-radius:7px;padding:10px 8px;background:transparent;color:var(--muted);cursor:pointer;font:600 12px 'Inter',sans-serif}
.purchase-mode-btn.active{background:linear-gradient(135deg,var(--brand-orange),var(--brand-gold));color:#171006}
.gift-note{margin:-12px 0 16px;color:#777d85;font-size:11px;line-height:1.45}
.product-card{cursor:pointer}
.product-modal-overlay{position:fixed;inset:0;z-index:5500;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.84);backdrop-filter:blur(9px)}
.product-modal-overlay.active{display:flex}
.product-modal{width:min(620px,100%);max-height:90vh;overflow:auto;background:var(--bg-panel);border:1px solid rgba(255,180,84,.2);border-radius:16px;box-shadow:0 25px 80px rgba(0,0,0,.55)}
.product-modal-top{position:relative}
.product-modal-image-wrap{height:230px;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.2);border-radius:16px 16px 0 0;overflow:hidden}
.product-modal-image-wrap img{max-width:90%;max-height:210px;object-fit:contain}
.product-modal-close{position:absolute;top:12px;right:12px;z-index:2;width:36px;height:36px;border-radius:50%;border:1px solid rgba(255,255,255,.12);background:rgba(0,0,0,.65);color:#fff;cursor:pointer;font-size:22px}
.product-modal-body{padding:24px}
.product-modal-title{margin:0 0 5px;font-family:'Fraunces',serif;color:var(--ivory);font-size:30px}
.product-modal-price{margin-bottom:20px;color:var(--brand-gold);font-weight:800;font-size:20px}
.product-modal-desc-box{padding:17px;margin-bottom:18px;border-radius:11px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.08)}
.product-modal-desc-label{margin-bottom:12px;color:var(--brand-gold);font:700 11px 'JetBrains Mono',monospace;letter-spacing:.15em;text-transform:uppercase}
.product-modal-desc-text{color:var(--muted);font-size:14px;line-height:1.7}
.product-modal-desc-text p{margin:0 0 12px}.product-modal-desc-text p:last-child{margin-bottom:0}
.product-modal-desc-text ul,.product-modal-desc-text ol{margin:10px 0 14px 22px}.product-modal-desc-text li{margin:5px 0}
.product-modal-desc-text table{width:100%;margin:16px 0 20px;border-collapse:separate;border-spacing:0;overflow:hidden;border:1px solid rgba(255,255,255,.09);border-radius:10px;background:rgba(0,0,0,.14);font-size:13px}
.product-modal-desc-text thead th{background:rgba(255,180,84,.10);color:var(--ivory);font-weight:800}
.product-modal-desc-text th,.product-modal-desc-text td{padding:10px 12px;text-align:left;vertical-align:top;border-right:1px solid rgba(255,255,255,.07);border-bottom:1px solid rgba(255,255,255,.07)}
.product-modal-desc-text tr:last-child td,.product-modal-desc-text tr:last-child th{border-bottom:0}
.product-modal-desc-text th:last-child,.product-modal-desc-text td:last-child{border-right:0}
.product-modal-desc-text tbody tr:nth-child(even){background:rgba(255,255,255,.025)}
.product-modal-desc-text tbody tr:hover{background:rgba(255,180,84,.045)}
.product-modal-desc-text caption{caption-side:top;padding:0 0 9px;text-align:left;color:var(--brand-gold);font-weight:800}
.product-modal-desc-text h1,.product-modal-desc-text h2,.product-modal-desc-text h3,.product-modal-desc-text h4{color:var(--ivory);margin:14px 0 8px}
.product-modal-desc-text a{color:var(--brand-gold)}
.modal-add-btn{width:100%;padding:13px;border:0;border-radius:9px;background:linear-gradient(135deg,var(--brand-orange),var(--brand-gold));color:#171006;font-weight:800;cursor:pointer}

.store-cart {
    position: sticky;
    top: 100px;
    background: rgba(23,26,31,.94);
    border: 1px solid rgba(255,180,84,.16);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 20px 55px rgba(0,0,0,.3);
}

.cart-close {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    background: rgba(255,255,255,.05);
    color: var(--ivory);
    cursor: pointer;
    font-size: 23px;
    line-height: 1;
}

.minecraft-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin: 5px 0 7px;
}

.minecraft-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: #0f1216;
    color: var(--ivory);
    outline: none;
}

.minecraft-input:focus {
    border-color: var(--teal);
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0;
    max-height: 390px;
    overflow-y: auto;
}

.cart-empty {
    padding: 28px 5px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.04);
}

.cart-item-name {
    color: var(--ivory);
    font-size: 13px;
    font-weight: 600;
}

.cart-item-price {
    color: var(--brand-gold);
    font-size: 13px;
    font-weight: 700;
}

.cart-controls {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 7px;
}

.qty-button,
.remove-button {
    border: 0;
    cursor: pointer;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    color: var(--ivory);
    padding: 5px 9px;
}

.qty-value {
    min-width: 24px;
    text-align: center;
    color: var(--ivory);
}

.remove-button {
    margin-left: auto;
    color: #ff8b80;
}

.cart-total {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 17px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
}

.cart-total strong {
    color: var(--ivory);
}

.checkout-button {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    background: linear-gradient(135deg, var(--brand-orange), var(--brand-gold));
    color: #171006;
}

.checkout-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.checkout-note {
    color: #777d85;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
    margin: 12px 0 0;
}

.checkout-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    padding: 35px;
    background: rgba(0,0,0,.82);
    backdrop-filter: blur(8px);
}

.checkout-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-window {
    width: min(1000px, 100%);
    height: min(850px, 94vh);
    overflow: auto;
    background: var(--bg-panel);
    border: 1px solid rgba(255,180,84,.2);
    border-radius: 16px;
    padding: 22px;
}

.checkout-window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.checkout-window-header h2 {
    margin: 4px 0 0;
    font-family: 'Fraunces', serif;
    color: var(--ivory);
}

.store-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 6000;
    max-width: 360px;
    padding: 13px 16px;
    border-radius: 9px;
    background: #171a1f;
    border: 1px solid rgba(255,180,84,.25);
    color: var(--ivory);
    box-shadow: 0 15px 40px rgba(0,0,0,.35);
    transform: translateY(30px);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
}

.store-toast.show {
    transform: none;
    opacity: 1;
}

@media (max-width: 900px) {
    .store-layout {
        grid-template-columns: 1fr;
    }

    .store-cart {
        position: fixed;
        top: 0;
        right: 0;
        width: min(390px, 100%);
        height: 100vh;
        z-index: 3000;
        border-radius: 0;
        transform: translateX(105%);
        transition: transform .22s ease;
        overflow-y: auto;
    }

    .store-cart.open {
        transform: translateX(0);
    }

    .product-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 901px) {
    .cart-close {
        display: none;
    }
}

@media (max-width: 600px) {
    .store-layout {
        width: min(100% - 24px, 1200px);
    }

    .store-hero {
        padding-top: 65px;
    }

    .checkout-overlay {
        padding: 8px;
    }

    .checkout-window {
        height: 98vh;
        border-radius: 10px;
        padding: 14px;
    }
}

.product-price-old{color:#ff5555;text-decoration:line-through;text-decoration-thickness:2px;margin-right:7px;font-size:.82em}.product-price-new{color:var(--brand-gold)}
.store-sale-banner{width:min(1200px,calc(100% - 40px));margin:0 auto 28px;padding:26px 30px;border:1px solid rgba(255,180,84,.28);border-radius:16px;background:linear-gradient(135deg,rgba(38,31,24,.98),rgba(25,28,33,.98));display:flex;align-items:center;justify-content:space-between;gap:24px}.store-sale-banner[hidden]{display:none}.store-sale-kicker{color:var(--brand-gold);font-size:11px;letter-spacing:.16em;text-transform:uppercase}.store-sale-banner h2{margin:5px 0}.store-sale-banner p{margin:0;color:var(--muted)}.store-sale-banner-button{padding:11px 17px;border-radius:9px;background:var(--brand-orange);color:#170a02;font-weight:700;text-decoration:none}.store-highlights{width:min(1200px,calc(100% - 40px));margin:0 auto 30px;display:grid;grid-template-columns:1.4fr .8fr;gap:18px}.store-highlight-card{background:linear-gradient(145deg,rgba(31,36,43,.96),rgba(23,26,31,.96));border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:22px}.store-highlight-heading{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:16px}.store-highlight-heading h2{margin:4px 0}.store-highlight-badge{color:var(--muted);font-size:11px}.recent-purchases{display:grid;gap:7px}.recent-purchase-row{display:grid;grid-template-columns:30px 1fr auto;gap:10px;align-items:center;padding:9px 10px;border-radius:9px;background:rgba(255,255,255,.035)}.recent-purchase-rank{color:var(--brand-gold)}.recent-purchase-main{min-width:0;display:grid}.recent-purchase-main strong{color:var(--ivory)}.recent-purchase-main span{color:var(--muted);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recent-purchase-price{color:var(--brand-gold);font-size:12px}.store-stat-empty{color:var(--muted);font-size:13px}.top-spender{min-height:130px;display:flex;align-items:center;gap:16px}.top-spender-avatar-wrap{width:76px;height:76px;padding:4px;border-radius:12px;background:rgba(255,180,84,.08);border:1px solid rgba(255,180,84,.22)}.top-spender-avatar-wrap img{width:100%;height:100%;image-rendering:pixelated;border-radius:8px}.top-spender-info{display:grid;gap:5px}.top-spender-info strong{color:var(--ivory);font-size:20px}.top-spender-info span:last-child{color:var(--brand-gold);font-weight:700}
@media(max-width:850px){.store-highlights{grid-template-columns:1fr}}

.store-tools{width:min(1200px,calc(100% - 40px));margin:0 auto 30px}.giftcard-checker{background:linear-gradient(145deg,rgba(31,36,43,.96),rgba(23,26,31,.96));border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:22px}.giftcard-checker p{color:var(--muted);margin:0 0 15px}.giftcard-form{display:flex;gap:10px;max-width:720px}.giftcard-input{flex:1;min-width:0;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.1);border-radius:9px;padding:12px 13px;color:var(--ivory);outline:none}.giftcard-input:focus{border-color:rgba(255,180,84,.45)}.giftcard-button{border:0;border-radius:9px;padding:12px 17px;background:var(--brand-orange);color:#170a02;font-weight:700;cursor:pointer}.giftcard-result{margin-top:12px;min-height:20px;font-size:13px}.giftcard-result.success{color:#75d88a}.giftcard-result.error{color:#ff7c7c}.giftcard-result.loading{color:var(--muted)}.product-expiration{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 2px;padding:7px 9px;border-radius:8px;background:rgba(255,180,84,.07);border:1px solid rgba(255,180,84,.12);font-size:10px}.product-expiration span{color:var(--muted);text-transform:uppercase;letter-spacing:.08em}.product-expiration strong{color:var(--brand-gold);font-size:11px;font-variant-numeric:tabular-nums}@media(max-width:600px){.giftcard-form{flex-direction:column}.giftcard-button{width:100%}}
