/* Double A SMP Store Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #01a1a4;
  --primary-dark: #007f81;
  --secondary: #f2b841;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --success: #10b981;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

body {
  font-family: var(--font-display);
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  animation: slideDown 0.5s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes bgPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-links a:hover, 
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.store-hero {
  padding: 6rem 2rem 2rem;
  text-align: center;
  position: relative;
}

.store-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(1, 161, 164, 0.15) 0%, transparent 70%);
}

.store-hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  animation: fadeInUp 1s ease;
}

.store-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.store-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeIn 1s ease 0.2s backwards;
}

.store-hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  animation: fadeIn 1s ease 0.3s backwards;
}

#username-display {
  animation: fadeIn 1s ease 0.4s backwards;
}

/* Category Navigation */
.category-nav {
  background: var(--dark-light);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 65px;
  z-index: 999;
  animation: fadeIn 1s ease 0.3s backwards;
}

.category-list {
  display: flex;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  overflow-x: auto;
  padding: 0.75rem;
  max-width: 1400px;
  margin: 0 auto;
}

.category-item {
  padding: 0.75rem 1.5rem;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.category-item:hover, 
.category-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* Products Section
 * 
 * SPACING ADJUSTMENTS:
 * - .products-section padding: top/bottom spacing around each section (currently 2rem = 32px)
 * - .products-section:first-child padding-top: spacing between category nav and first section (currently 1.5rem = 24px)
 * - .section-subtitle margin-bottom: spacing between subtitle and product grid (currently 2rem = 32px)
 * 
 * To adjust spacing:
 * 1. Between category nav and "Server Ranks" title: change .products-section:first-child padding-top
 * 2. Between rank packages and "Server Crates" title: change .products-section padding (top value)
 * 3. Between crate packages and footer: change .products-section padding (bottom value)
 */
.products-section {
  padding: 2rem 2rem; /* Reduced from 4rem to 2rem */
  animation: fadeInUp 0.8s ease;
}

.products-section:first-child {
  padding-top: 1.5rem; /* Even less padding for first section after category nav */
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.section-subtitle {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem; /* Reduced from 3rem to 2rem */
  font-size: 1.125rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem 1.5rem;
  margin-bottom: 4rem;
  margin-top: 1.5rem;
}

/* Product Cards */
.product-card {
  background: var(--dark-light);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 1.5rem 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: visible;
  animation: fadeInUp 0.6s ease backwards;
  margin-top: 1rem;
}

/* Staggered animation delays for cards */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.product-icon {
  font-size: 3rem;
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

/* Product Image */
.product-image {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 1rem;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
}

.product-badge {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-block;
  padding: 0.25rem 2.5rem;
  background: rgba(1, 161, 164, 0.15);
  border: 1px solid var(--primary);
  border-radius: 50px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.product-badge.popular {
  background: rgba(242, 184, 65, 0.15);
  border-color: var(--secondary);
  color: var(--secondary);
}

.product-badge.premium {
  background: rgba(147, 51, 234, 0.15);
  border-color: #9333ea;
  color: #a855f7;
}

.product-badge.ultimate {
  background: rgba(234, 51, 51, 0.15);
  border-color: #ff2f33;
  color: #f94f52;
}

.product-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.product-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
}

.product-price-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
}

.product-description {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.5;
}

.view-details-text {
  text-align: center;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--dark-light);
  border: 2px solid var(--border);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.modal-close:hover {
  color: var(--text);
  background: var(--border);
}

.modal-icon {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 1rem;
}

/* Modal Image */
.modal-image {
  width: 50%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
  margin-bottom: -30px;
}

.modal-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.modal-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
}

.modal-price-subtitle {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.95rem;
}

.modal-body {
  padding: 2rem;
}

.perk-section {
  margin-bottom: 2rem;
}

.perk-section:last-child {
  margin-bottom: 0;
}

.perk-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
}

.perk-list {
  list-style: none;
}

.perk-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-muted);
}

.perk-list li:last-child {
  border-bottom: none;
}

.perk-icon {
  color: var(--success);
  font-weight: bold;
  flex-shrink: 0;
}

.perk-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-top: 0.5rem;
  display: block;
}

.modal-footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

.button-group {
  display: flex;
  gap: 1rem;
}

.buy-btn {
  flex: 1;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.buy-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(1, 161, 164, 0.4);
}

.buy-btn.subscription {
  background: var(--secondary);
}

.buy-btn.subscription:hover {
  background: #d4a135;
}

.btn-label {
  font-size: 0.75rem;
  text-transform: none;
  opacity: 0.9;
  display: block;
  margin-bottom: 0.25rem;
}

/* Footer */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  animation: fadeIn 1s ease;
}

.footer-content {
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-text {
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--dark);
    border-left: 1px solid var(--border);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1.125rem;
  }

  body.menu-open {
    overflow: hidden;
  }
  
  .store-hero { 
    padding: 6rem 1rem 3rem; 
  }

  .store-hero h1 {
    font-size: 2rem;
  }
  
  .products-grid { 
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }
  
  .button-group { 
    flex-direction: column; 
  }

  .category-nav {
    padding: 1rem;
  }

  .category-list {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .category-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .container {
    padding: 0 1rem;
  }

  /* Ensure Tebex checkout modal works on mobile */
  .tebex-checkout-modal,
  [class*="tebex"] {
    position: fixed !important;
    z-index: 10000 !important;
  }

  /* Make custom dialogs work on mobile */
  .custom-dialog {
    width: 95%;
    max-width: 400px;
    padding: 1.5rem;
  }

  .custom-dialog-overlay {
    padding: 1rem;
  }

  /* Adjust badge for tablet screens */
  .product-badge {
    padding: 0.25rem 1.75rem;
    font-size: 0.7rem;
  }

  .product-card {
    margin-top: 0.75rem;
  }
}

@media (max-width: 480px) {
  .store-hero h1 {
    font-size: 1.75rem;
  }

  .store-hero p {
    font-size: 0.9375rem;
  }

  .product-card {
    padding: 2rem 1rem 1rem;
    margin-top: 0.75rem;
  }

  .product-title {
    font-size: 1.25rem;
  }

  /* Adjust badge for smaller screens */
  .product-badge {
    padding: 0.25rem 1.25rem;
    font-size: 0.65rem;
    top: 0.3rem;
  }

  .product-icon {
    font-size: 2.5rem;
    margin-top: 0.25rem;
  }

  .product-image {
    height: 150px;
    margin-top: 0.25rem;
  }
}

/* Scrollbar */
.modal-content::-webkit-scrollbar {
  width: 10px;
}

.modal-content::-webkit-scrollbar-track {
  background: var(--dark);
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

/* ========================================
   STORE-SPECIFIC STYLES (from inline)
   ======================================== */

/* Force ranks grid to 3 columns */
#ranks-grid.products-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Make rank card images fit properly */
.product-card .product-image {
  width: 100%;
  height: 250px;
  object-fit: scale-down;
  border-radius: 8px;
}

@media (max-width: 1024px) {
  #ranks-grid.products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  #ranks-grid.products-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Tebex Modal Overrides for Mobile */
.tebex-checkout-wrapper,
.tebex-checkout-modal,
[class*="tebex-checkout"],
iframe[src*="checkout.tebex.io"] {
  position: fixed !important;
  z-index: 9999 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border: none !important;
}

.tebex-checkout-overlay,
[class*="tebex"][class*="overlay"] {
  position: fixed !important;
  z-index: 9998 !important;
  background: rgba(0, 0, 0, 0.8) !important;
}

@media (max-width: 768px) {
  .tebex-checkout-modal,
  .tebex-checkout-wrapper {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* Custom Dialog Styles */
.custom-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.custom-dialog-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.custom-dialog {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.custom-dialog-overlay.active .custom-dialog {
  transform: scale(1) translateY(0);
}

.custom-dialog-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
}

.custom-dialog-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.5rem;
}

.custom-dialog-message {
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.custom-dialog-input {
  width: 100%;
  padding: 0.875rem;
  background: var(--dark);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-display);
  margin-bottom: 1.5rem;
  transition: border-color 0.3s ease;
}

.custom-dialog-input:focus {
  outline: none;
  border-color: var(--primary);
}

.custom-dialog-buttons {
  display: flex;
  gap: 0.75rem;
}

.custom-dialog-btn {
  flex: 1;
  padding: 0.875rem;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.custom-dialog-btn.primary {
  background: var(--primary);
  color: white;
}

.custom-dialog-btn.primary:hover {
  background: #019a9d;
  transform: translateY(-2px);
}

.custom-dialog-btn.secondary {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}

.custom-dialog-btn.secondary:hover {
  border-color: var(--text);
}

.custom-dialog-btn.warning {
  background: #ef4444;
  color: white;
}

.custom-dialog-btn.warning:hover {
  background: #dc2626;
}

/* Community Stats Section */
.community-stats-section {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 3rem 0;
  margin-bottom: 2rem;
}

.community-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.stat-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.stat-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.goal-progress {
  margin: 1.5rem 0;
}

.goal-bar {
  background: var(--border);
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.goal-fill {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  height: 100%;
  transition: width 0.5s ease;
  width: 0%;
}

.goal-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.goal-text span {
  color: var(--primary);
}

.top-customer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-height: 120px;
  justify-content: center;
}

.customer-skin {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
}

.customer-username {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.loading-spinner {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stat-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .community-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Shopping Cart Styles */
.cart-float-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(1, 161, 164, 0.4);
  z-index: 1000;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-float-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(1, 161, 164, 0.6);
}

.cart-badge {
  background: var(--secondary);
  color: var(--bg);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
}

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

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h3 {
  font-size: 1.5rem;
  color: var(--text);
  margin: 0;
}

.cart-close-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.cart-close-btn:hover {
  color: var(--primary);
}

.cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.cart-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.cart-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: scale-down;
  border-radius: 6px;
  flex-shrink: 0;
}

.cart-item-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  color: var(--primary);
  font-weight: 600;
}

.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.cart-item-remove:hover {
  color: #ef4444;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.cart-total span:last-child {
  color: var(--primary);
}

.cart-checkout-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cart-checkout-btn:hover {
  background: #019a9d;
  transform: translateY(-2px);
}

.cart-checkout-btn:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 768px) {
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
  
  .cart-float-button {
    bottom: 1rem;
    right: 1rem;
    padding: 0.875rem 1.25rem;
  }
}

/* Success Modal Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Force footer borders to be full-width */
.footer {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
}


/* Ensure footer borders span full viewport width on store page */
body > .footer,
#footer-placeholder > .footer {
  box-sizing: border-box;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* ========================================
   SIDEBAR LAYOUT
   ======================================== */

/* Store layout container */
.store-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  align-items: start;
  margin-top: 2rem;
}

/* Main content area */
.store-main {
  min-width: 0; /* Prevents grid blowout */
  width: 100%;
  padding: 0 !important; /* Remove default container padding since layout handles it */
  max-width: none !important; /* Override container max-width */
  margin: 0 !important; /* Override container margin */
}

/* Sidebar */
.store-sidebar {
  width: 100%;
  max-width: 320px;
  position: sticky;
  padding: 10px;
  top: 15rem; /* Reduced from 2rem to prevent cutoff */
  align-self: start;
  height: fit-content;
  max-height: calc(100vh - 2rem); /* Prevent sidebar from being taller than viewport */
  overflow-y: auto; /* Allow scrolling if sidebar content is too tall */
}

.sidebar-sticky {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sidebar cards */
.sidebar-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.sidebar-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(1, 161, 164, 0.2);
}

.sidebar-card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.sidebar-card-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary);
  font-weight: 700;
}

.sidebar-card-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

/* Goal progress in sidebar */
.sidebar-card .goal-progress {
  margin: 1rem 0;
}

.sidebar-card .goal-bar {
  background: var(--border);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.sidebar-card .goal-fill {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  height: 100%;
  transition: width 0.5s ease;
  width: 0%;
}

.sidebar-card .goal-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.sidebar-card .goal-text span {
  color: var(--primary);
}

/* Top customer in sidebar */
.sidebar-card .top-customer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-height: 100px;
  justify-content: center;
}

.sidebar-card .customer-skin {
  width: auto;
  height: 150px;
  object-fit: contain;
  image-rendering: pixelated;
}

.sidebar-card .customer-username {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.sidebar-card .loading-spinner {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive: Mobile layout */
@media (max-width: 1024px) {
  .store-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .store-sidebar {
    width: 100%;
    max-width: 100%;
    position: static; /* Remove sticky on mobile */
    order: -1; /* Move sidebar above main content on mobile */
  }
  
  .sidebar-sticky {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .store-layout {
    padding: 0 1rem;
  }
  
  .sidebar-sticky {
    grid-template-columns: 1fr;
  }
}

/* Hide old community stats section (now using sidebar) */
.community-stats-section {
  display: none !important;
}