/* Advanced Discounts Frontend Styles */

.wc-advanced-discounts-offers {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    border-radius: 4px;
}

.wc-advanced-discounts-category-offers {
    margin: 8px 0;
    font-size: 0.9em;
}

.advanced-discount-offer {
    margin-bottom: 8px;
}

.advanced-discount-offer:last-child {
    margin-bottom: 0;
}

.offer-link {
    display: inline-block;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.offer-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: #fff !important;
}

.offer-link:before {
    content: '🎁';
    margin-right: 6px;
}

.offer-link.loading {
    opacity: 0.7;
    pointer-events: none;
}

.offer-link.loading:after {
    content: '⏳';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Category page offers */
.category-offer .offer-link {
    font-size: 0.8em;
    padding: 6px 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.category-offer .offer-link:hover {
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.4);
}

/* Modal Overlay */
.wc-ad-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Container */
.wc-ad-modal-content {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease-out;
}

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

/* Modal Header */
.wc-ad-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px 30px;
  border-radius: 16px 16px 0 0;
  position: relative;
  text-align: center;
}

.wc-ad-modal-header h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.5px;
}

/* Close Button */
.wc-ad-modal-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.wc-ad-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Modal Body */
.wc-ad-modal-body {
  padding: 30px;
}

.offer-description {
  font-size: 18px;
  color: #2c3e50;
  text-align: center;
  margin: 0 0 32px 0;
  font-weight: 500;
  line-height: 1.5;
}

/* Products Section */
.products-section h4 {
  color: #2c3e50;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 24px 0;
  text-align: center;
  position: relative;
}

.products-section h4:after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* Individual Product Items */
.product-item {
  background: #ffffff;
  border: 2px solid #f1f3f4;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.product-item:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.product-item:hover {
  border-color: #667eea;
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.15);
}

.product-item:hover:before {
  left: 100%;
}

.product-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Product Images */
.product-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto 16px;
  display: block;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

/* Product Titles */
.product-item h5 {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 12px 0;
  line-height: 1.3;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Product Prices */
.product-item .price {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #27ae60;
}

.woocommerce-Price-amount {
  font-size: inherit;
}

.woocommerce-Price-currencySymbol {
  font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
  .wc-ad-modal {
    padding: 10px;
  }
  
  .wc-ad-modal-content {
    border-radius: 12px;
    max-height: 95vh;
  }
  
  .wc-ad-modal-header {
    padding: 20px;
    border-radius: 12px 12px 0 0;
  }
  
  .wc-ad-modal-header h3 {
    font-size: 22px;
  }
  
  .wc-ad-modal-body {
    padding: 20px;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
  }
  
  .product-item {
    padding: 16px;
  }
  
  .product-item h5 {
    font-size: 14px;
    min-height: 35px;
  }
  
  .offer-description {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .product-item img {
    width: 60px;
    height: 60px;
  }
  
  .product-item h5 {
    font-size: 13px;
  }
  
  .product-item .price {
    font-size: 16px;
  }
}