/* Shop Page Styles */
:root {
  --primary-color: #2a9d8f;
  --primary-hover: #21867a;
  --secondary-color: #e63946;
  --text-color: #333;
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --dark-gray: #6c757d;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.product-card {
  border: 1px solid var(--medium-gray);
  border-radius: 8px;
  padding: 1.5rem;
  transition: var(--transition);
  background-color: white;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--primary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: var(--primary-color);
}

.product-image-container {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background-color: var(--light-gray);
  margin-bottom: 1rem;
  flex-grow: 1;
  display: flex;
  align-items: center;
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  transition: var(--transition);
  padding: 1rem;
}

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

.product-info {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}

.product-title {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  color: var(--text-color);
  font-weight: 600;
  line-height: 1.4;
}

.product-description {
  color: var(--dark-gray);
  font-size: 0.9rem;
  margin: 0.5rem 0;
  flex-grow: 1;
}

.product-price {
  font-weight: 700;
  color: var(--secondary-color);
  font-size: 1.25rem;
  margin: 0.5rem 0;
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--medium-gray);
  background: white;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.quantity-btn:hover {
  background-color: var(--light-gray);
}

.quantity-input {
  width: 50px;
  height: 30px;
  text-align: center;
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
}

.add-to-cart {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
  transition: var(--transition);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.add-to-cart:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.cart-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    padding: 1rem;
  }
  
  .product-image {
    height: 160px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .product-card {
    padding: 1rem;
  }
  
  .add-to-cart {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
  
  .cart-icon {
    width: 16px;
    height: 16px;
  }
}

/* Floating Cart Styles */
.floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.cart-icon-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.cart-icon-wrapper:hover {
    transform: scale(1.1);
    background-color: var(--primary-hover);
}

.cart-icon-wrapper .cart-icon {
    width: 24px;
    height: 24px;
    fill: white;
}

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

.cart-preview {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.floating-cart:hover .cart-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--medium-gray);
    font-size: 14px;
}

.empty-cart {
    padding: 15px;
    text-align: center;
    color: var(--dark-gray);
}

.view-cart-btn {
    display: block;
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 12px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.view-cart-btn:hover {
    background: var(--primary-hover);
    text-decoration: none;
}

/* Animation for cart update */
@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.cart-update {
    animation: cartBounce 0.5s ease;
}

/* Feedback Messages */
.feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

.feedback.success {
    background-color: #4CAF50;
}

.feedback.error {
    background-color: #f44336;
}

@keyframes slideIn {
    from { top: -50px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}

.cart-feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; top: 10px; }
    20% { opacity: 1; top: 20px; }
    80% { opacity: 1; top: 20px; }
    100% { opacity: 0; top: 10px; }
}

/* Cart feedback styles */
.cart-feedback {
    position: absolute;
    padding: 10px 15px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    pointer-events: none;
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: opacity 0.3s ease;
}

.cart-feedback.success {
    background-color: #28a745;
}

.cart-feedback.error {
    background-color: #dc3545;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cart count animation */
.cart-update {
    animation: bounce 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Quantity input styles */
.quantity-input {
    text-align: center;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}