/* Global Variables */
:root {
    --primary-color: #FF9900;
    --secondary-color: #007185;
    --nav-bg: #131921;
    --text-color: #111;
    --bg-color: #EAEDED;
    --card-bg: #fff;
    --hover-shadow: rgba(0, 0, 0, 0.2);
  }
  
  /* Reset & Global Styles */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  body {
    font-family: 'Amazon Ember', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    animation: fadeIn 1s ease-out;
  }
  img {
    max-width: 100%;
    display: block;
  }
  
  /* Keyframe Animations */
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  @keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* Header */
  .header {
    background-color: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  .header-top {
    max-width: 1200px;
    margin: auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .logo {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
  }
  .header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
  }
  .search-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
  }
  .cart-link {
    color: #fff;
    text-decoration: none;
    position: relative;
    font-size: 20px;
  }
  .cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--primary-color);
    color: var(--text-color);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
  }
  
  /* Header Search (hidden by default) */
  .header-search {
    display: none;
    background-color: #fff;
    padding: 10px 20px;
    animation: slideDown 0.5s ease-out;
  }
  .header-search.active {
    display: block;
  }
  .search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
  }
  
  /* Sort & Filter Section */
  .sort-filter {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
  .sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sort-options label {
    font-size: 14px;
    color: #555;
  }
  .sort-options select {
    padding: 5px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  
  /* Products Grid (Listing & Suggested) */
  .products-grid {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 0 20px;
  }
  
  /* Loading Spinner */
  .loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ccc;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 40px auto;
  }
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  /* Product Card (Listing) */
  .product-card {
    background-color: var(--card-bg);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    animation: slideUp 0.8s ease-out forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .product-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--hover-shadow);
  }
  .image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
  }
  .product-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .product-info {
    padding: 10px 15px;
  }
  .product-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
  }
  .price-section {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
  }
  .original-price {
    font-size: 12px;
    color: #888;
    text-decoration: line-through;
  }
  .sale-price {
    font-size: 14px;
    font-weight: bold;
    color: #B12704;
  }
  .discount-badge {
    background-color: #F08804;
    color: #fff;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
  }
  .stock-status {
    font-size: 12px;
    margin-top: 5px;
  }
  .in-stock {
    color: green;
  }
  .out-of-stock {
    color: red;
  }
  
  /* Product Detail Page */
  .product-detail {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    animation: fadeIn 0.8s ease-out;
  }
  .product-detail-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  }
  .product-images {
    flex: 1 1 400px;
    max-width: 600px;
  }
  .main-image-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin-bottom: 10px;
  }
  .main-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .thumbnail-container {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
  }
  .thumbnail-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border 0.3s ease;
  }
  .thumbnail-image:hover {
    border-color: var(--primary-color);
  }
  .product-details {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
  }
  .detail-name {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
  }
  .detail-model,
  .detail-category {
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
  }
  .detail-description {
    font-size: 16px;
    color: #333;
    margin: 15px 0;
  }
  .product-detail .price-section {
    margin: 15px 0;
  }
  .product-detail .stock-status {
    font-size: 14px;
    margin-bottom: 15px;
  }
  .action-buttons {
    display: flex;
    gap: 10px;
  }
  .add-to-cart,
  .share-product {
    flex: 1;
    padding: 10px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.3s ease;
  }
  .add-to-cart {
    background-color: var(--primary-color);
    color: var(--text-color);
  }
  .add-to-cart:hover {
    background-color: #e68a00;
    transform: scale(1.05);
  }
  .share-product {
    background-color: var(--secondary-color);
    color: #fff;
  }
  .share-product:hover {
    background-color: #005f66;
    transform: scale(1.05);
  }
  
  /* Suggested Products Section */
  .suggested-products {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
  }
  .suggested-products h2 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
  }
  
  /* Back to Top Button */
  .back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
  }
  .back-to-top:hover {
    transform: scale(1.1);
  }
  
  /* Responsive */
  @media (max-width: 768px) {
    .header-top {
      flex-direction: column;
      align-items: flex-start;
    }
    .header-search {
      padding: 10px;
    }
    .product-detail-container {
      flex-direction: column;
    }
    .main-image-container {
      height: 300px;
    }
    .thumbnail-image {
      width: 80px;
      height: 80px;
    }
  }
  