/* ===== GLOBAL STYLES ===== */
:root {
  --primary: #4285f4;
  --primary-hover: #3367d6;
  --text: #333333;
  --text-light: #666666;
  --border: #dddddd;
  --success: #16a34a;
  --error: #dc2626;
  --white: #ffffff;
  --shadow: 0 2px 5px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 1px auto 30px;
  padding: 0 5px;
}

/* ===== HEADER & NAVIGATION ===== */
.shop-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.shop-title {
  font-size: 24px;
  margin: 0 0 5px;
}

.product-count {
  color: var(--text-light);
  font-size: 14px;
  margin: 0 0 15px;
}

.sort-form {
  align-self: flex-start;
}

.sort-select {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 14px;
  background-color: var(--white);
}

/* ===== PRODUCT GRID ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 20px 0;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (min-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px;
  background: var(--white);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image-container {
  position: relative;
  width: 100%;
  height: 150px;
  margin-bottom: 12px;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* ===== PRODUCT INFO ===== */
.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 16px;
  margin: 0 0 8px;
  line-height: 1.3;
}

.product-title a {
  color: var(--text);
  text-decoration: none;
}

.product-title a:hover {
  color: var(--primary);
}

.product-short-desc {
  font-size: 13px;
  color: var(--text-light);
  margin: 0 0 10px;
  line-height: 1.4;
  flex: 1;
}

.product-price {
  font-weight: bold;
  font-size: 16px;
  margin: 8px 0;
  color: var(--text);
}

.stock-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: inline-block;
  margin-bottom: 10px;
}

.in-stock {
  background-color: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.out-of-stock {
  background-color: rgba(220, 38, 38, 0.1);
  color: var(--error);
}

/* ===== ACTION BUTTONS ===== */
.product-actions {
  margin-top: auto;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-action {
  flex: 1;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: none;
  cursor: pointer;
  background-color: var(--primary);
  color: var(--white);
}

.btn-action:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 0 8px rgba(66, 133, 244, 0.4);
}

.btn-action:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== SOCIAL MEDIA BUTTONS ===== */
.social-media-buttons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  background-color: var(--white);
  padding: 5px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.social-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 12px;
}

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

.facebook { background-color: #3b5998; }
.youtube { background-color: #ff0000; }
.instagram { background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d); }
.x { background-color: #3b5998; }

/* ===== CART DISPLAY ===== */
.cart-display {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1000;
}

.cart-badge {
  display: flex;
  align-items: center;
  background: var(--white);
  padding: 8px 15px;
  border-radius: 50px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.cart-badge:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-hover);
}

.cart-badge i {
  font-size: 18px;
  margin-right: 8px;
  color: var(--primary);
}

.cart-badge .total {
  font-weight: bold;
  font-size: 14px;
}

.cart-badge .count {
  background-color: var(--primary);
  color: var(--white);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-left: 5px;
}

/* ===== ALERTS & MESSAGES ===== */
.alert-danger {
  padding: 10px 15px;
  background-color: rgba(220, 38, 38, 0.1);
  color: var(--error);
  border-radius: 4px;
  margin-bottom: 20px;
  border-left: 3px solid var(--error);
}

/* ===== EMPTY STATE ===== */
.no-products {
  text-align: center;
  padding: 40px 20px;
}

.no-products h2 {
  margin-bottom: 10px;
}

.no-products p {
  margin-bottom: 20px;
  color: var(--text-light);
}

.no-products .btn-action {
  display: inline-flex;
  width: auto;
  padding: 8px 20px;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (min-width: 576px) {
  .product-image-container {
    height: 180px;
  }
  
  .btn-action {
    font-size: 14px;
  }
}

@media (min-width: 768px) {
  .product-image-container {
    height: 200px;
  }
  
  .product-title {
    font-size: 17px;
  }
  
  .product-price {
    font-size: 18px;
  }
}

@media (min-width: 992px) {
  .social-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
}


/* Add to Cart Notification */
.add-to-cart-notification {
    position: fixed;
    top: 60px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    display: none;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.add-to-cart-notification.success {
    background-color: #4CAF50;
}

.add-to-cart-notification.error {
    background-color: #f44336;
}

.add-to-cart-notification i {
    margin-right: 10px;
}

/* Cart Count Badge */
.cart-badge .count {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #ff5722;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    margin-left: 5px;
}

/* Button States */
.btn-cart.added {
    background-color: #4CAF50 !important;
}

.btn-cart[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}