/* ===== GLOBAL STYLES ===== */
:root {
  --primary-color: #0066cc;
  --secondary-color: #00aa44;
  --danger-color: #dd3333;
  --warning-color: #ff9900;
  --light-bg: #f5f5f5;
  --border-color: #ddd;
  --text-dark: #333;
  --text-light: #666;
}

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

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

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

/* ===== HEADER & NAVIGATION ===== */
header {
  background: white;
  border-bottom: 2px solid var(--primary-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
}

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

nav a {
  font-weight: 500;
  color: var(--text-dark);
}

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

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

.cart-icon {
  position: relative;
  font-size: 20px;
  cursor: pointer;
}

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

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: #0052a3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

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

.btn-secondary:hover {
  background-color: #008833;
}

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

.btn-danger:hover {
  background-color: #bb2222;
}

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

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

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* ===== CONTAINER & LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main {
  min-height: calc(100vh - 70px - 200px);
  padding: 40px 20px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

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

.flex {
  display: flex;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-between {
  justify-content: space-between;
  align-items: center;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.card-body {
  padding: 20px;
}

.card-header {
  background-color: var(--light-bg);
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.card-footer {
  background-color: var(--light-bg);
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
}

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

.product-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background-color: var(--light-bg);
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--danger-color);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.product-info {
  padding: 15px;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

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

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

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

.discount-badge {
  background-color: var(--secondary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
}

.product-rating {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  font-size: 14px;
}

.stars {
  color: #ffc107;
}

.review-count {
  color: var(--text-light);
}

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

.product-actions .btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
}

/* ===== FILTERS & SEARCH ===== */
.filters {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  cursor: pointer;
}

.filter-option label {
  cursor: pointer;
  flex: 1;
}

.search-box {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 14px;
  margin-bottom: 10px;
}

.search-box:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* ===== CART PAGE ===== */
.cart-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  margin-top: 30px;
}

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

.cart-items {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

.cart-item:last-child {
  border-bottom: none;
}

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

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

.cart-item-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.cart-item-price {
  color: var(--text-light);
  font-size: 14px;
}

.quantity-control {
  display: flex;
  gap: 5px;
  align-items: center;
}

.quantity-control button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-color);
  background: white;
  cursor: pointer;
  border-radius: 3px;
  font-weight: bold;
}

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

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

.cart-summary {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 90px;
}

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

.summary-row.total {
  border-top: 2px solid var(--border-color);
  padding-top: 12px;
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-color);
}

.empty-cart {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-cart .btn {
  margin-top: 20px;
}

/* ===== CHECKOUT PAGE ===== */
.checkout-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  margin-top: 30px;
}

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

.checkout-form {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 30px;
}

.form-section {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.form-group {
  margin-bottom: 15px;
}

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

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="phone"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* ===== FOOTER ===== */
footer {
  background-color: #1a1a1a;
  color: #e0e0e0;
  padding: 40px 20px;
  margin-top: 60px;
  border-top: 2px solid var(--primary-color);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: white;
}

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

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

.footer-section a {
  color: #e0e0e0;
}

.footer-section a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.payment-methods {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.payment-methods img {
  height: 30px;
  opacity: 0.8;
}

/* ===== ALERTS & MESSAGES ===== */
.alert {
  padding: 15px 20px;
  border-radius: 5px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* ===== LOADING & SPINNER ===== */
.spinner {
  border: 4px solid var(--light-bg);
  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); }
}

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-light);
}

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

  .header-container {
    height: 60px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .cart-container {
    grid-template-columns: 1fr;
  }

  .checkout-container {
    grid-template-columns: 1fr;
  }

  .product-card {
    margin-bottom: 15px;
  }
}

/* ===== PAYMENT GATEWAY SPECIFIC ===== */
.payment-option {
  padding: 15px;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.payment-option:hover {
  border-color: var(--primary-color);
  background-color: rgba(0, 102, 204, 0.05);
}

.payment-option input[type="radio"] {
  margin-right: 10px;
}

.payment-option.selected {
  border-color: var(--primary-color);
  background-color: rgba(0, 102, 204, 0.1);
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--secondary-color);
  margin-top: 20px;
  padding: 12px;
  background-color: rgba(0, 170, 68, 0.1);
  border-radius: 5px;
}

.security-badge .lock {
  font-size: 16px;
}
