/* Responsive improvements for better mobile experience */

/* Extra small devices (phones, 320px and up) */
@media (max-width: 320px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .product-card {
    border-radius: 8px;
  }
  
  .product-img {
    height: 200px;
  }
  
  .product-info {
    padding: 1rem;
  }
  
  .product-info h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
  }
  
  .product-price {
    font-size: 1rem;
    margin-bottom: 0.8rem;
  }
  
  .add-to-cart {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
}

/* Small devices (phones, 480px and up) */
@media (min-width: 321px) and (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  
  .product-img {
    height: 220px;
  }
  
  .product-info h3 {
    font-size: 1.1rem;
  }
  
  .product-price {
    font-size: 1.1rem;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 481px) and (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
  }
  
  .product-img {
    height: 200px;
  }
}

/* Large devices (desktops, 769px and up) */
@media (min-width: 769px) and (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.8rem;
  }
}

/* Extra large devices (large desktops, 1025px and up) */
@media (min-width: 1025px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
  }
}

/* Improved product card hover effect for touch devices */
@media (hover: none) and (pointer: coarse) {
  .product-card:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
  .add-to-cart {
    min-height: 44px; /* Minimum touch target size */
  }
  
  .product-info h3 a {
    display: block;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Improve spacing for mobile product details */
  .product-detail-container {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .product-images {
    width: 100%;
  }
  
  .product-info {
    width: 100%;
  }
}

/* Product detail page improvements */
@media (max-width: 480px) {
  .product-detail-container {
    padding: 0 2%;
  }
  
  .thumbnail-images {
    gap: 0.5rem;
  }
  
  .thumbnail {
    width: 60px;
    height: 60px;
  }
  
  .product-price {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .original-price {
    margin-left: 0;
  }
  
  .product-options {
    gap: 1rem;
  }
  
  .size-options,
  .color-options {
    gap: 0.5rem;
  }
  
  .size-option,
  .color-option {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Cart page responsive improvements */
@media (max-width: 768px) {
  .cart-content {
    flex-direction: column;
  }
  
  .cart-items {
    width: 100%;
    margin-bottom: 2rem;
  }
  
  .cart-summary {
    width: 100%;
  }
  
  .cart-table {
    display: block;
  }
  
  .cart-table thead {
    display: none;
  }
  
  .cart-table tbody {
    display: block;
  }
  
  .cart-table tr {
    display: block;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
  }
  
  .cart-table td {
    display: block;
    text-align: right;
    padding: 0.5rem 0;
    border: none;
  }
  
  .cart-table td:before {
    content: attr(data-label) ": ";
    float: left;
    font-weight: bold;
    color: var(--text-color);
  }
  
  .cart-product {
    flex-direction: column;
    text-align: center;
  }
  
  .cart-product img {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
  }
  
  .quantity-control {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .cart-table tr {
    padding: 0.8rem;
  }
  
  .cart-product img {
    width: 80px;
    height: 80px;
  }
  
  .summary-row {
    font-size: 0.9rem;
  }
  
  .total-row {
    font-size: 1.1rem;
  }
}