/* Twixos Store Styles */

.store-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  min-height: 100vh;
}

.store-header {
  text-align: center;
  margin-bottom: 40px;
}

.store-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--primary-color, #667eea);
}

.store-header p {
  font-size: 1.1rem;
  color: #888;
}

.store-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  background: #2a2a3e;
  border: 2px solid #3a3a4e;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: #3a3a4e;
  border-color: #667eea;
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Store Filters */
.store-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 15px;
  margin-bottom: 30px;
  padding: 20px;
  background: #2a2a3e;
  border-radius: 12px;
}

.store-filters input,
.store-filters select {
  padding: 12px;
  background: #1a1a2e;
  border: 1px solid #3a3a4e;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
}

/* Featured Products */
.featured-products {
  margin-bottom: 40px;
}

.featured-products h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #fff;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.featured-product-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.featured-product-card .product-image {
  position: relative;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
}

.featured-product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

.featured-product-card .product-info h4 {
  color: #fff;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.featured-product-card .price {
  color: #fff;
  font-size: 1.3rem;
  font-weight: bold;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.product-card {
  background: #2a2a3e;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid transparent;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-color: #667eea;
}

.product-image {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.1);
}

.digital-badge,
.low-stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.digital-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.low-stock-badge {
  background: #ff6b6b;
  color: #fff;
  top: 45px;
}

.product-details {
  padding: 20px;
}

.product-details h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #fff;
  line-height: 1.4;
}

.product-description {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 15px;
  line-height: 1.5;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.price {
  font-size: 1.4rem;
  font-weight: bold;
  color: #667eea;
}

.category {
  font-size: 0.85rem;
  color: #888;
  text-transform: capitalize;
  padding: 4px 10px;
  background: #3a3a4e;
  border-radius: 12px;
}

/* Shopping Cart */
.cart-icon {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
  z-index: 100;
  transition: transform 0.3s ease;
}

.cart-icon:hover {
  transform: scale(1.1);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff6b6b;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.cart-sidebar {
  position: fixed;
  right: -450px;
  top: 0;
  width: 450px;
  height: 100vh;
  background: #2a2a3e;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.cart-header {
  padding: 20px;
  background: #1a1a2e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #3a3a4e;
}

.cart-header h3 {
  margin: 0;
  color: #fff;
}

.close-cart {
  background: none;
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 1;
}

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

.empty-cart {
  text-align: center;
  padding: 40px 20px;
  color: #888;
}

.cart-items {
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: #1a1a2e;
  border-radius: 8px;
  margin-bottom: 15px;
  position: relative;
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-details h4 {
  margin: 0 0 5px 0;
  font-size: 1rem;
  color: #fff;
}

.cart-item-details .variant {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 5px;
}

.cart-item-details .price {
  color: #667eea;
  font-weight: bold;
  margin-bottom: 10px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-controls button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3a3a4e;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.quantity-controls button:hover {
  background: #667eea;
}

.remove-item {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #ff6b6b;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 1;
}

.cart-summary {
  border-top: 2px solid #3a3a4e;
  padding-top: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #aaa;
}

.summary-row.success {
  color: #51cf66;
}

.summary-row.total {
  font-size: 1.3rem;
  font-weight: bold;
  color: #fff;
  border-top: 2px solid #3a3a4e;
  padding-top: 10px;
  margin-top: 10px;
}

/* Product Detail Modal */
.product-detail-modal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

.product-detail-image img {
  width: 100%;
  border-radius: 12px;
}

.product-detail-info h2 {
  margin-top: 0;
  color: #fff;
}

.product-detail-price {
  font-size: 2rem;
  color: #667eea;
  font-weight: bold;
  margin: 15px 0;
}

.product-detail-description {
  color: #aaa;
  line-height: 1.6;
  margin-bottom: 20px;
}

.digital-info {
  background: #2a2a3e;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.digital-info .badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 10px;
}

.variant-selector,
.quantity-selector {
  margin-bottom: 20px;
}

.variant-selector h4 {
  margin-bottom: 10px;
  color: #fff;
}

.variant-selector select,
.quantity-selector input {
  width: 100%;
  padding: 12px;
  background: #2a2a3e;
  border: 1px solid #3a3a4e;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
}

.product-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
}

/* Checkout */
.checkout-container {
  max-width: 600px;
  margin: 0 auto;
}

.checkout-container h2 {
  color: #fff;
  margin-bottom: 30px;
}

.checkout-container h3 {
  color: #fff;
  margin: 25px 0 15px;
}

.shipping-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  background: #2a2a3e;
  border: 1px solid #3a3a4e;
  border-radius: 8px;
  color: #fff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.order-summary {
  background: #2a2a3e;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #aaa;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.3rem;
  font-weight: bold;
  color: #fff;
  border-top: 2px solid #3a3a4e;
  padding-top: 15px;
  margin-top: 15px;
}

.payment-section {
  background: #2a2a3e;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
}

#checkout-card-element {
  padding: 15px;
  background: #1a1a2e;
  border: 1px solid #3a3a4e;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* Inventory */
.inventory-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
}

.stat h3 {
  font-size: 3rem;
  margin: 0 0 10px 0;
  color: #fff;
}

.stat p {
  margin: 0;
  color: #fff;
  opacity: 0.9;
}

.inventory-section {
  margin-bottom: 40px;
}

.inventory-section h3 {
  color: #fff;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

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

.inventory-item {
  background: #2a2a3e;
  border: 2px solid #3a3a4e;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.inventory-item.equipped {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.inventory-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

.inventory-item h4 {
  color: #fff;
  margin-bottom: 15px;
}

/* Orders */
.order-card {
  background: #2a2a3e;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  border: 2px solid #3a3a4e;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #3a3a4e;
}

.order-header h3 {
  margin: 0;
  color: #fff;
}

.status-badge {
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  text-transform: capitalize;
}

.status-pending {
  background: #ffd43b;
  color: #000;
}

.status-processing {
  background: #339af0;
  color: #fff;
}

.status-shipped {
  background: #51cf66;
  color: #fff;
}

.status-delivered {
  background: #37b24d;
  color: #fff;
}

.status-cancelled {
  background: #ff6b6b;
  color: #fff;
}

.order-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
  color: #aaa;
}

.order-items {
  margin-bottom: 20px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: #1a1a2e;
  border-radius: 8px;
  margin-bottom: 10px;
}

.order-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.delivered-badge {
  margin-left: auto;
  color: #51cf66;
  font-weight: bold;
}

.order-actions {
  display: flex;
  gap: 10px;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state p {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.no-products {
  text-align: center;
  padding: 60px 20px;
  color: #888;
  grid-column: 1 / -1;
}

/* Order Confirmation */
.order-confirmation {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: #51cf66;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #fff;
}

.order-confirmation h2 {
  color: #fff;
  margin-bottom: 15px;
}

.order-details {
  background: #2a2a3e;
  padding: 20px;
  border-radius: 12px;
  margin: 25px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .store-filters {
    grid-template-columns: 1fr;
  }

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

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

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

  .cart-sidebar {
    width: 100%;
    right: -100%;
  }

  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .order-details {
    grid-template-columns: 1fr;
  }
}

/* Loading and Error States */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #888;
  grid-column: 1 / -1;
}

.error-message {
  text-align: center;
  padding: 40px 20px;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 12px;
  grid-column: 1 / -1;
}

/* Button Styles */
.btn-block {
  width: 100%;
  margin-bottom: 10px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* Theme Support */
[data-theme="dark"] .store-container {
  color: var(--text-primary);
}

[data-theme="dark"] .product-card {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .product-card:hover {
  border-color: var(--primary);
}

[data-theme="dark"] .cart-sidebar {
  background: var(--bg-secondary);
}

[data-theme="dark"] .cart-header {
  background: var(--bg-tertiary);
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .cart-item {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .store-filters input,
[data-theme="dark"] .store-filters select {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="light"] .store-container {
  color: var(--text-primary);
}

[data-theme="light"] .product-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
}

[data-theme="light"] .product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .cart-sidebar {
  background: var(--bg-primary);
}

[data-theme="light"] .cart-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
}

[data-theme="light"] .cart-item {
  background: var(--bg-secondary);
}

[data-theme="light"] .store-filters {
  background: var(--bg-secondary);
}

[data-theme="light"] .store-filters input,
[data-theme="light"] .store-filters select {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="light"] .product-details h3,
[data-theme="light"] .featured-product-card .product-info h4 {
  color: var(--text-primary);
}

[data-theme="light"] .price {
  color: var(--primary);
}

[data-theme="light"] .product-description {
  color: var(--text-secondary);
}

[data-theme="light"] .category {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Spinner */
.spinner {
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Smooth transitions */
.product-card,
.cart-sidebar,
.tab-btn,
button {
  transition: all 0.3s ease;
}

/* Accessibility improvements */
.product-card:focus,
.tab-btn:focus,
button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Product image fallback */
.product-image img {
  background: var(--bg-tertiary);
}

/* Cart icon pulse animation when items added */
@keyframes cartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.cart-icon.pulse {
  animation: cartPulse 0.3s ease;
}

/* Better scrollbar for cart */
.cart-content::-webkit-scrollbar {
  width: 8px;
}

.cart-content::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

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

.cart-content::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}
