/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0806;
    --card-bg: rgba(20, 16, 12, 0.7);
    --gold: #e5c158;
    --gold-glow: rgba(229, 193, 88, 0.2);
    --gold-dark: #b8860b;
    --text-main: #e7e5e4;
    --text-muted: #a8a29e;
    --border: rgba(229, 193, 88, 0.15);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Ambient Glow */
.ambient-glow {
    position: fixed;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(229, 193, 88, 0.08) 0%, rgba(10, 8, 6, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Helper Class for Cinzel Font */
.cinzel-header {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Navigation Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 8, 6, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: 3px;
    color: #fff;
}

.gold-text {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    font-family: 'Cinzel', serif;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--gold);
    text-shadow: 0 0 8px var(--gold-glow);
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(229, 193, 88, 0.1);
    border: 1px solid var(--border);
    color: var(--gold);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.cart-btn:hover {
    background: rgba(229, 193, 88, 0.2);
    transform: translateY(-2px);
}

.cart-count {
    background: var(--gold);
    color: var(--bg-dark);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.1rem 0.4rem;
    border-radius: 50%;
}

/* Store container */
.store-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(229, 193, 88, 0.25);
}

.hero .subtitle {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    font-size: 1.1rem;
}

/* Toggle Container */
.toggle-container {
    display: inline-flex;
    background: rgba(20, 16, 12, 0.9);
    border: 1px solid var(--border);
    padding: 0.4rem;
    border-radius: 6px;
    gap: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem 1.8rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    color: var(--gold);
}

.toggle-btn.active {
    background: var(--gold);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(229, 193, 88, 0.4);
}

/* Grid Layout */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    width: 100%;
    transition: opacity 0.3s ease;
}

.products-grid.hidden {
    display: none;
}

/* Product Card */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(229, 193, 88, 0.4);
    box-shadow: 0 20px 48px rgba(229, 193, 88, 0.1);
}

/* Card Glow Overlay */
.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--color, var(--gold-glow)) 0%, transparent 50%);
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.product-card:hover .card-glow {
    opacity: 0.25;
}

/* Special tags */
.popular-tag {
    position: absolute;
    top: 15px;
    right: -30px;
    background: var(--gold);
    color: var(--bg-dark);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.3rem 2.5rem;
    transform: rotate(45deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Rank Card styling */
.rank-badge {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.citizen-badge { color: #ffffff; text-shadow: 0 0 10px rgba(255,255,255,0.2); }
.squire-badge { color: #e5c158; text-shadow: 0 0 10px rgba(229,193,88,0.25); }
.knight-badge { color: #38bdf8; text-shadow: 0 0 10px rgba(56,189,248,0.25); }
.baron-badge { color: #ec4899; text-shadow: 0 0 10px rgba(236,72,153,0.25); }

.price-tag {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
}

.price-tag .period {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.or-gold {
    font-size: 0.85rem;
    color: var(--gold);
    margin-bottom: 2rem;
    font-style: italic;
}

/* Perks List */
.perks-list {
    list-style: none;
    width: 100%;
    margin-bottom: 2.5rem;
    border-top: 1px solid rgba(229, 193, 88, 0.1);
    padding-top: 1.5rem;
}

.perks-list li {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.2rem;
    text-align: left;
}

.perks-list li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--gold);
    font-size: 0.75rem;
}

.perk-highlight {
    color: #fff;
    font-weight: 600;
}

/* Buy Button */
.buy-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.8rem 1.5rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-top: auto;
}

.buy-btn:hover {
    background: var(--gold);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(229, 193, 88, 0.3);
}

/* Gold treasury items */
.gold-icon-wrapper {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.gold-coins-icon {
    background: radial-gradient(circle, #ffe066 0%, #d97706 80%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(217, 119, 6, 0.4);
    position: relative;
}

.gold-coins-icon.small { width: 50px; height: 50px; }
.gold-coins-icon.medium { width: 70px; height: 70px; }
.gold-coins-icon.large { width: 90px; height: 90px; }
.gold-coins-icon.massive { 
    width: 100px; 
    height: 100px; 
    box-shadow: 0 0 35px rgba(217, 119, 6, 0.6);
}

.gold-amount {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.gold-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    min-height: 70px;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100vh;
    background: #0f0c09;
    border-left: 1px solid var(--border);
    z-index: 200;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(229, 193, 88, 0.1);
    padding-bottom: 1rem;
}

.cart-header h2 {
    font-size: 1.5rem;
    color: #fff;
}

.close-cart {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-cart:hover {
    color: #fff;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
}

.empty-msg {
    color: var(--text-muted);
    text-align: center;
    margin-top: 3rem;
    font-style: italic;
    font-size: 0.95rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 16, 12, 0.5);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.item-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.remove-item {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 0.5rem;
}

.cart-footer {
    border-top: 1px solid rgba(229, 193, 88, 0.1);
    padding-top: 1.5rem;
    margin-top: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.total-price {
    color: var(--gold);
    font-size: 1.3rem;
}

.checkout-btn {
    width: 100%;
    background: var(--gold);
    color: var(--bg-dark);
    border: none;
    padding: 1rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(229, 193, 88, 0.2);
}

.checkout-btn:hover {
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}
