/**
 * ProductCCA - Main Stylesheet
 * 
 * Theme-agnostic design with proper namespacing to prevent conflicts.
 * All custom classes are prefixed with 'productcca-' to avoid collisions.
 * 
 * @author WBF
 * @copyright 2025 WBF
 * @license Commercial License - All Rights Reserved
 * @version 1.0.0
 */

/* ============================================
   MODULE CORE STYLES
   Scoped to module containers only
   ============================================ */

/* Keep styles minimal and rely on PrestaShop/Hummingbird defaults */
.productcca-row { 
    margin-bottom: 1rem; 
}

.productcca_search_results { 
    max-height: 240px; 
    overflow-y: auto; 
}

.productcca_search_results .clickable { 
    cursor: pointer; 
}

/* Enhanced pricing display styles - Scoped to module containers */
.productcca-container .product-pricing,
.productcca-item .product-pricing {
  margin-bottom: 0.75rem;
}

.productcca-container .product-pricing .current-price,
.productcca-item .product-pricing .current-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.productcca-container .product-pricing .price,
.productcca-item .product-pricing .price {
  font-size: 1.125rem;
  font-weight: 600;
}

.productcca-container .product-pricing .regular-price,
.productcca-item .product-pricing .regular-price {
  font-size: 1rem;
}

.productcca-container .product-pricing .discount-badge,
.productcca-item .product-pricing .discount-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.productcca-container .product-pricing .price-details,
.productcca-item .product-pricing .price-details {
  line-height: 1.3;
}

.productcca-container .product-pricing .price-details > div,
.productcca-item .product-pricing .price-details > div {
  margin-bottom: 0.125rem;
}

/* Hide empty parentheses in pricing displays - Scoped to module */
.productcca-container .product-pricing *:empty,
.productcca-container .product__unit-price *:empty,
.productcca-item .product-pricing *:empty,
.productcca-item .product__unit-price *:empty {
  display: none;
}

/* Quantity input group: ensure buttons and input heights match across themes */
.productcca-item .input-group .form-control {
  min-width: 64px;
}

/* Hide native number input arrows so we only show our +/- controls */
.productcca-item input[type="number"]::-webkit-outer-spin-button,
.productcca-item input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.productcca-item input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Cart subline styling: aligned with product names */
.productcca-cart-note {
  margin-top: 0.25rem;
}

/* ============================================
   CART LABEL BADGES
   ============================================ */

/* Enhanced badge styling for cart labels */
.productcca-cart-note .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

/* Ensure compatibility with both Bootstrap 4 and 5 */
.productcca-cart-note .badge.bg-primary {
  background-color: var(--productcca-main-badge-color, #007bff);
  color: var(--productcca-main-text-color, white);
}

/* Fallback for older Bootstrap versions */
.productcca-cart-note .badge-primary {
  background-color: var(--productcca-main-badge-color, #007bff);
  color: var(--productcca-main-text-color, white);
}

/* Enhanced Dual Label System - v6.1.1 - CHECKOUT DUAL LABELING */
.productcca-dual-labels {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0.25rem;
}

/* Main labels container - horizontal layout */
.productcca-main-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* Component labels container - horizontal layout */
.productcca-component-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* Main product badges - uses CSS variables from module configuration */
.productcca-main-badge {
  background-color: var(--productcca-main-badge-color, #007bff);
  color: var(--productcca-main-text-color, white);
  font-size: 0.75rem !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 0.25rem !important;
  font-weight: 500 !important;
  border: 1px solid rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.productcca-main-badge:hover {
  filter: brightness(0.9);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Component product badges - uses CSS variables from module configuration */
.productcca-component-badge {
  background-color: var(--productcca-component-badge-color, #ffc107);
  color: var(--productcca-component-text-color, #212529);
  font-size: 0.75rem !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 0.25rem !important;
  font-weight: 500 !important;
  border: 1px solid rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.productcca-component-badge:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Enhanced animations for dual role detection */
.productcca-dual-labels.dual-role {
  border-left: 3px solid #17a2b8;
  padding-left: 0.5rem;
  background: linear-gradient(90deg, rgba(23,162,184,0.05) 0%, transparent 100%);
}

/* Stacking animation for visual appeal */
.productcca-dual-labels > div {
  animation: fadeInUp 0.3s ease-out;
}

.productcca-main-labels > .productcca-main-badge {
  animation: fadeInUp 0.3s ease-out;
  animation-delay: 0.1s;
  animation-fill-mode: both;
}

.productcca-component-labels > .productcca-component-badge {
  animation: fadeInUp 0.3s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments for mobile checkout */
@media (max-width: 576px) {
  .productcca-dual-labels {
    gap: 2px;
  }
  
  .productcca-main-badge,
  .productcca-component-badge {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
  }
}

/* INTEGRATED DUAL LABELING - Works with existing checkout sections */

/* Enhanced dual label badges for Show details and Produsele comenzii */
.cart-detailed-info a[href*="-"]::after,
.js-show-details a[href*="-"]::after,
.order-products a[href*="-"]::after,
.order-confirmation-table a[href*="-"]::after {
  /* Dual labeling badges inherit from main CSS in getOrderLabelsHtml() */
  animation: fadeInLabels 0.3s ease-out;
}

/* Ensure proper spacing for dual badges in detailed sections */
.cart-detailed-info .product-line,
.js-show-details .product-line,
.order-products .product-line,
.order-confirmation-table .product-line {
  position: relative;
  padding-bottom: 1rem; /* Extra space for dual badges */
}

/* Animation for label appearance */
@keyframes fadeInLabels {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments for mobile */
@media (max-width: 576px) {
  .cart-detailed-info a[href*="-"]::after,
  .js-show-details a[href*="-"]::after,
  .order-products a[href*="-"]::after,
  .order-confirmation-table a[href*="-"]::after {
    max-width: 250px;
    font-size: 9px;
  }
}

/* DEPRECATED: Separate block styles - keeping for reference */
.productcca-checkout-summary-dual-labels {
  border-left: 4px solid #17a2b8;
  background: linear-gradient(90deg, rgba(23,162,184,0.05) 0%, transparent 100%);
}

.productcca-checkout-summary-dual-labels .card-header {
  background-color: #f8f9fa !important;
  border-bottom: 1px solid #dee2e6;
}

.productcca-order-confirmation-dual-labels {
  border-left: 4px solid #28a745;
  background: linear-gradient(90deg, rgba(40,167,69,0.05) 0%, transparent 100%);
}

.productcca-order-confirmation-dual-labels .table th {
  border-top: none;
  font-weight: 600;
  color: #495057;
}

.productcca-order-confirmation-dual-labels .table td {
  vertical-align: middle;
}

/* Enhanced table styling for order confirmation */
.productcca-order-confirmation-dual-labels .table-responsive {
  border-radius: 0.375rem;
  overflow: hidden;
}

.productcca-order-confirmation-dual-labels .table tbody tr:hover {
  background-color: rgba(0,0,0,0.02);
}

/* Legacy compatibility - keep existing styles for backwards compatibility */
.productcca-enhanced-labels {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.productcca-main-label .badge {
  background-color: var(--productcca-main-badge-color, #007bff);
  color: var(--productcca-main-text-color, white);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.productcca-component-label .badge {
  background-color: var(--productcca-component-badge-color, #ffc107);
  color: var(--productcca-component-text-color, #212529);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

/* Hide native wishlist button when wishlist toggle is disabled */
.productcca-hide-native-wishlist .wishlist-add-to,
.productcca-hide-native-wishlist .wishlist-button,
.productcca-hide-native-wishlist .wishlist_button,
.productcca-hide-native-wishlist [data-button-action="add-to-wishlist"],
.productcca-hide-native-wishlist .btn-wishlist,
.productcca-hide-native-wishlist .add-to-wishlist,
.productcca-hide-native-wishlist .wishlist-btn,
.productcca-hide-native-wishlist .wishlist-button-add,
.productcca-hide-native-wishlist .wishlist-button-product,
.productcca-hide-native-wishlist .wishlist-button-list,
.productcca-hide-native-wishlist .wishlist-add-product,
.productcca-hide-native-wishlist .wishlist-button-ajax,
.productcca-hide-native-wishlist .wishlist-add-button,
.productcca-hide-native-wishlist .wishlist-compare-button,
.productcca-hide-native-wishlist .wishlist-block,
.productcca-hide-native-wishlist .product-actions .wishlist,
.productcca-hide-native-wishlist .product-miniature .wishlist,
.productcca-hide-native-wishlist .js-wishlist-add-to,
.productcca-hide-native-wishlist [class*="wishlist"] {
  display: none !important;
}
