/* Swift Shopping - Bedding Store Styles */
:root {
  --primary-color: #1a3a5c;
  --secondary-color: #2c5282;
  --accent-color: #c9a227;
  --text-dark: #1a202c;
  --text-light: #718096;
  --bg-light: #f7fafc;
  --white: #ffffff;
  --border-color: #e2e8f0;
  --sale-color: #e53e3e;
  --success-color: #38a169;
}

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

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

/* Header & Navigation */
header {
  background: var(--white);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.top-bar {
  background: var(--primary-color);
  color: var(--white);
  padding: 8px 0;
  font-size: 13px;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  letter-spacing: -1px;
}

.logo span {
  color: var(--accent-color);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
}

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

nav a:hover {
  color: var(--primary-color);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s;
}

nav a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.header-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: relative;
  transition: transform 0.2s;
}

.header-btn:hover {
  transform: scale(1.1);
}

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

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 20px;
  font-weight: 700;
}

.hero p {
  font-size: 20px;
  margin-bottom: 30px;
  opacity: 0.9;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  font-size: 16px;
}

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

.btn-primary:hover {
  background: #b8922a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.4);
}

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

.btn-secondary:hover {
  background: var(--bg-light);
}

/* Products Section */
.section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  font-size: 32px;
  margin-bottom: 40px;
  color: var(--primary-color);
  font-weight: 700;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.product-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.product-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
}

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

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

.sale-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--sale-color);
  color: var(--white);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
}

.product-info {
  padding: 20px;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

.original-price {
  font-size: 16px;
  color: var(--text-light);
  text-decoration: line-through;
}

.add-to-cart-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 15px;
}

.add-to-cart-btn:hover {
  background: var(--secondary-color);
}

/* Categories Section */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.category-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

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

.category-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 58, 92, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.category-card:hover .category-overlay {
  background: rgba(26, 58, 92, 0.5);
}

.category-name {
  color: var(--white);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  padding: 20px;
}

/* Footer */
footer {
  background: var(--primary-color);
  color: var(--white);
  padding: 60px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-column h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--accent-color);
}

.footer-column ul {
  list-style: none;
}

.footer-column li {
  margin-bottom: 10px;
}

.footer-column a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-column a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

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

/* Cart Page */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cart-table th {
  background: var(--primary-color);
  color: var(--white);
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

.cart-table td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

.cart-table tr:last-child td {
  border-bottom: none;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

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

.quantity-input {
  width: 60px;
  padding: 5px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.remove-btn {
  background: var(--sale-color);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.remove-btn:hover {
  background: #c53030;
}

.cart-summary {
  background: var(--white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 16px;
}

.summary-row.total {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  padding-top: 15px;
  border-top: 2px solid var(--border-color);
}

/* Product Detail Page */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: var(--white);
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-detail-image {
  border-radius: 8px;
  overflow: hidden;
}

.product-detail-image img {
  width: 100%;
  height: auto;
  display: block;
}

.product-detail-info h1 {
  font-size: 32px;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.product-detail-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.product-detail-description {
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 30px;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.quantity-selector button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
}

.quantity-selector button:hover {
  background: var(--bg-light);
}

/* Responsive */
@media (max-width: 768px) {
  nav ul {
    display: none;
  }

  .hero h1 {
    font-size: 32px;
  }

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

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

  .cart-item-info {
    flex-direction: column;
    text-align: center;
  }
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--success-color);
  color: var(--white);
  padding: 15px 25px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 10000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}
