/**
 * スマートポリスECショップ
 * 共通スタイルシート
 */

/* ==================== リセット & 基本設定 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* カラーパレット */
  --primary-color: #1e3a5f;
  --primary-dark: #152a45;
  --accent-color: #ff6b35;
  --accent-hover: #e65a2b;
  --bg-light: #f8f9fa;
  --text-dark: #333;
  --text-light: #666;
  --border-color: #ddd;
  --success-color: #28a745;
  --error-color: #dc3545;
  --warning-color: #ffc107;
  
  /* スペーシング */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* シャドウ */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
  
  /* トランジション */
  --transition: all 0.3s ease;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-light);
}

/* ==================== ヘッダー ==================== */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: var(--spacing-sm) 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

.nav-links a {
  color: white;
  text-decoration: none;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 5px;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.1);
}

.cart-icon {
  position: relative;
  cursor: pointer;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

/* ==================== コンテナ ==================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-md);
}

.section {
  margin-bottom: var(--spacing-xl);
}

/* ==================== ボタン ==================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* ==================== カード ==================== */
.card {
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.product-card {
  cursor: pointer;
}

.product-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.product-info {
  padding: var(--spacing-md);
}

.product-category {
  color: var(--accent-color);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.product-name {
  margin: 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

/* ==================== フォーム ==================== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.error-message {
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ==================== テーブル ==================== */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
}

.table th {
  background: var(--bg-light);
  font-weight: 600;
  color: var(--primary-color);
}

.table tbody tr {
  border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
  background: var(--bg-light);
}

/* ==================== バッジ ==================== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-success {
  background: #d4edda;
  color: var(--success-color);
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-danger {
  background: #f8d7da;
  color: var(--error-color);
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

/* ==================== ローディング ==================== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-xl);
}

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

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

/* ==================== フッター ==================== */
footer {
  background: var(--primary-color);
  color: white;
  padding: var(--spacing-xl) 0 var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.footer-section h3 {
  margin-bottom: var(--spacing-sm);
  color: var(--accent-color);
}

.footer-links {
  list-style: none;
}

.footer-links a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-color);
  padding-left: 0.5rem;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-md);
  margin-top: var(--spacing-md);
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.875rem;
}

/* ==================== レスポンシブ ==================== */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
}
