/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (AFL-3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */

.faceted-overlay {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  background-color: rgba(25, 25, 25, 0.5);
  z-index: 100;

  .overlay__inner {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    position: absolute;
  }

  .overlay__content {
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .spinner {
    width: 75px;
    height: 75px;
    display: inline-block;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.05);
    border-top-color: #fff;
    animation: spin 1s infinite linear;
    border-radius: 100%;
    border-style: solid;
  }
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Quickview Modal Styles */
.quickview {
  .modal-dialog {
    width: calc(100% - 30px);
    max-width: 64rem;
    margin: 1.75rem auto;
  }

  .modal-content {
    width: 100%;
    min-height: 28.13rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  }

  .modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
    border-radius: 0.5rem 0.5rem 0 0;
    
    .modal-title {
      font-size: 1.25rem;
      font-weight: 600;
      color: #212529;
      margin: 0;
    }
    
    .close {
      padding: 0;
      margin: -1rem -1rem -1rem auto;
      font-size: 1.5rem;
      color: #6c757d;
      background: none;
      border: none;
      cursor: pointer;
      
      &:hover {
        color: #495057;
      }
    }
  }

  .modal-body {
    min-height: 23.75rem;
    padding: 1.5rem;
    
    .row {
      margin: 0;
    }
    
    .col-md-6 {
      padding: 0 0.75rem;
    }
  }

  .modal-footer {
    border-top: 1px solid #dee2e6;
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
  }

  /* Product Images */
  .product-cover img {
    width: 100%;
    height: auto;
    border-radius: 0.25rem;
  }

  .images-container {
    z-index: 1;
    display: flex;
    min-height: 21.88rem;

    .product-images > li.thumb-container .thumb {
      width: 100%;
      max-width: 4.938rem;
      height: auto;
      margin-bottom: 0.8125rem;
      background: #fff;
      border-radius: 0.25rem;
    }
  }

  /* Product Variants */
  .product-variants {
    margin-bottom: 1rem;
    
    .product-variants-item {
      margin-bottom: 0.75rem;
      
      .control-label {
        font-weight: 600;
        color: #495057;
        margin-bottom: 0.5rem;
        display: block;
      }
      
      select.form-control {
        border: 1px solid #ced4da;
        border-radius: 0.25rem;
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
        
        &:focus {
          border-color: #80bdff;
          box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        }
      }
      
      ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        
        li {
          margin: 0;
          
          label {
            cursor: pointer;
            margin: 0;
            
            input[type="radio"] {
              margin-right: 0.25rem;
            }
            
            .radio-label {
              font-size: 0.875rem;
              color: #495057;
            }
          }
        }
      }
    }
  }

  /* Color variants */
  .input-color {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    
    + span {
      display: inline-block;
      width: 2rem;
      height: 2rem;
      border-radius: 50%;
      border: 2px solid #dee2e6;
      cursor: pointer;
      transition: all 0.2s ease;
      
      &:hover {
        border-color: #007bff;
        transform: scale(1.1);
      }
    }
    
    &:checked + span {
      border-color: #007bff;
      border-width: 3px;
    }
  }

  /* Product Actions */
  .product-actions {
    margin-top: 1rem;
    
    .product-quantity {
      margin-bottom: 1rem;
      
      .qty {
        display: flex;
        align-items: center;
        
        input {
          width: 4rem;
          text-align: center;
          border: 1px solid #ced4da;
          border-radius: 0.25rem;
          padding: 0.375rem;
          margin: 0 0.5rem;
        }
      }
    }
    
    .btn-add-to-cart {
      background: #007bff;
      color: #fff;
      border: none;
      padding: 0.75rem 1.5rem;
      border-radius: 0.25rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      width: 100%;
      
      &:hover:not(:disabled) {
        background: #0056b3;
        transform: translateY(-1px);
      }
      
      &:disabled {
        background: #6c757d;
        cursor: not-allowed;
      }
      
      i {
        margin-right: 0.5rem;
      }
    }
  }

  /* Product Prices */
  .product-prices {
    margin-bottom: 1rem;
    
    .price {
      font-size: 1.25rem;
      font-weight: 700;
      color: #28a745;
    }
    
    .regular-price {
      font-size: 1rem;
      color: #6c757d;
      text-decoration: line-through;
      margin-right: 0.5rem;
    }
    
    .discount-percentage,
    .discount-amount {
      background: #dc3545;
      color: #fff;
      padding: 0.25rem 0.5rem;
      border-radius: 0.25rem;
      font-size: 0.75rem;
      font-weight: 600;
      margin-left: 0.5rem;
    }
  }

  /* Product Description */
  #product-description-short {
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  /* TouchSpin Styles */
  .touchspin {
    display: flex;
    align-items: center;
    
    .btn-touchspin {
      background: #f8f9fa;
      border: 1px solid #ced4da;
      color: #495057;
      padding: 0.375rem 0.5rem;
      cursor: pointer;
      
      &:hover {
        background: #e9ecef;
      }
    }
  }
}

/* Quickview Button Styles */
.quick-view {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
  
  &:hover {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-decoration: none;
  }
  
  i {
    margin-right: 0.5rem;
  }
}

.product-miniature:hover .quick-view {
  opacity: 1;
}

.btn-select-variants {
  background: #17a2b8;
  color: #fff;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  
  &:hover {
    background: #138496;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
  }
  
  i {
    margin-right: 0.5rem;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .quickview {
    .modal-dialog {
      width: calc(100% - 20px);
      margin: 0.5rem auto;
    }
    
    .modal-body {
      padding: 1rem;
      
      .col-md-6 {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
      }
    }
    
    .product-variants ul {
      justify-content: center;
    }
  }
}
