@layer components {

  /* Shop Product Page */

  .add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;

    &:hover {
      transform: none;
    }
  }

  .shop-card-image {
    width: 100%;
    height: 260px;
    object-fit: contain;
    background: var(--light-gray);
    border-radius: var(--border-radius-2);

    @media (max-width: 767px) {
      height: 200px;
    }
  }

  .shop-product {
    padding-block: 2rem;
  }

  .shop-product__gallery {
    max-width: 600px;
  }

  .shop-product__image-main {
    border-radius: var(--border-radius-2);
    overflow: hidden;
    background: var(--light-gray);

    img {
      width: 100%;
      height: 400px;
      object-fit: cover;

      @media (max-width: 767px) {
        height: 280px;
      }
    }
  }

  .shop-product__thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
  }

  .shop-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-1);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 0;
    background: var(--light-gray);
    transition: border-color 0.2s;

    &.active {
      border-color: var(--primary);
    }

    &:hover {
      border-color: var(--primary);
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .shop-product__info {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .shop-product__price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
  }

  .shop-product__description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--dark-gray);
    margin: 0;
  }

  .shop-product__features {
    margin-top: 10px;

    h3 {
      font-size: 1.25rem;
      font-weight: 600;
      margin-bottom: 15px;
    }

    ul {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    li {
      font-size: 1.125rem;
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 0;

      span {
        color: var(--primary);
        font-weight: 700;
        font-size: 1.25rem;
      }
    }
  }

  .shop-product__actions {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
  }

  .shop-add-to-cart {
    background: var(--primary);
    color: var(--white);
    border: none;
    font-weight: 600;
    font-size: 1.125rem;
    padding: 0.75rem 2.5rem;

    &:hover {
      background: var(--secondary);
      color: var(--black);
    }
  }

  /* Cart notification */

  .shop-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: var(--border-radius-1);
    font-size: 1.125rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;

    &.visible {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }

  /* Cart badge on header */

  .cart-link {
    position: relative;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    font-size: 1rem;
  }

  .cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--primary);
    color: var(--white);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
  }

  /* Cart Page */

  .shop-cart-empty {
    text-align: center;
    padding: 4rem 2rem;

    p {
      font-size: 1.5rem;
      color: var(--dark-gray);
      margin-bottom: 2rem;
    }
  }

  .shop-cart-items {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .shop-cart-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--gray);

    @media (max-width: 767px) {
      flex-wrap: wrap;
      gap: 15px;
    }
  }

  .shop-cart-item__image {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius-1);
    overflow: hidden;
    flex-shrink: 0;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    @media (max-width: 767px) {
      width: 80px;
      height: 80px;
    }
  }

  .shop-cart-item__details {
    h3 {
      font-size: 1.25rem;
      font-weight: 600;
      margin: 0;
    }

    p {
      margin: 5px 0 0;
      color: var(--primary);
      font-weight: 600;
    }
  }

  .shop-cart-item__total {
    min-width: 100px;
    text-align: right;

    p {
      font-size: 1.25rem;
      font-weight: 700;
      margin: 0;
    }
  }

  .shop-cart-item__remove {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--dark-gray);
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;

    &:hover {
      color: #dc3545;
    }
  }

  /* Cart Summary */

  .shop-cart-summary,
  .shop-checkout-summary {
    width: 380px;
    background: var(--light-gray);
    padding: 2rem;
    border-radius: var(--border-radius-2);
    align-self: flex-start;
    position: sticky;
    top: 2rem;

    @media (max-width: 1199px) {
      width: 100%;
      position: static;
    }

    h3 {
      font-size: 1.5rem;
      font-weight: 600;
      margin-bottom: 1.5rem;
    }
  }

  .shop-cart-summary__row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--gray);

    &:last-of-type {
      border-bottom: none;
    }
  }

  .shop-cart-summary__total {
    font-weight: 700;
    font-size: 1.375rem;
    padding-top: 1rem;
    border-top: 2px solid var(--black);
    border-bottom: none;
  }

  .shop-checkout-btn {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border: none;
    font-weight: 600;
    margin-top: 1.5rem;
    text-align: center;
  }

  .shop-continue-btn {
    width: 100%;
    margin-top: 0.75rem;
    text-align: center;
  }

  /* Checkout Form */

  .shop-checkout-form {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .shop-checkout-section {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--gray);

    &:last-of-type {
      border-bottom: none;
      margin-bottom: 1rem;
    }

    h3 {
      font-size: 1.375rem;
      font-weight: 600;
      margin-bottom: 1.5rem;
    }
  }

  .shop-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;

    label {
      font-size: 0.95rem;
      font-weight: 500;
      color: var(--dark-gray);
      line-height: 1.4;
    }

    input,
    select {
      padding: 0.75rem 1rem;
      border: 2px solid var(--gray);
      border-radius: var(--border-radius-1);
      font-size: 1rem;
      color: var(--black);
      background: var(--white);
      transition: border-color 0.2s;

      &:focus {
        outline: none;
        border-color: var(--primary);
      }

      &::placeholder {
        color: #aaa;
      }
    }

    select {
      cursor: pointer;
    }
  }

  .shop-payment-icons {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    align-items: center;

    img {
      height: 30px;
      width: auto;
    }
  }

  .shop-place-order-btn {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border: none;
    font-weight: 700;
    font-size: 1.25rem;
    padding: 1rem;
    margin-top: 1rem;

    &:disabled {
      opacity: 0.6;
      cursor: not-allowed;

      &:hover {
        transform: none;
      }
    }
  }

  /* Checkout summary items */

  .shop-checkout-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray);

    &:last-child {
      margin-bottom: 1rem;
    }
  }

  .shop-checkout-item__image {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-1);
    overflow: hidden;
    flex-shrink: 0;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .shop-checkout-item__name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
  }

  .shop-checkout-item__qty {
    font-size: 0.875rem;
    color: var(--dark-gray);
    margin: 3px 0 0;
  }

  .shop-checkout-item__price {
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
  }

  /* Order Success */

  .shop-checkout-success {
    text-align: center;
    padding: 4rem 2rem;

    h2 {
      font-size: 2.5rem;
      font-weight: 600;
      margin: 1.5rem 0 1rem;
    }

    p {
      font-size: 1.25rem;
      color: var(--dark-gray);
      max-width: 500px;
      margin-inline: auto;
    }
  }

  .shop-checkout-success__icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto;
  }
}
