/**
 * Product Master Variants - Styles
 */

/* Variant Cards */
.variant-card {
    transition: all 0.2s ease;
}

.variant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.variant-card.active {
    border: 2px solid #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

/* Variant List Styles */
.variant-list-card {
    border: none;
    border-radius: 0.5rem;
    height: 100%;
}

.variant-list {
    max-height: 400px;
    overflow-y: auto;
}

.variant-list-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.variant-list-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.variant-list-item.active {
    background-color: #e7f1ff;
    border-color: #0d6efd;
}

/* Variant Badges */
.variant-list-item .badge {
    background-color: #6c757d !important;
    color: white !important;
}

/* Filter Section */
.filter-section-card {
    border: none;
    border-radius: 0.5rem;
}

.filter-section-card .card-header {
    border-bottom: 1px solid #e9ecef;
}

.filters-container {
    max-height: 400px;
    overflow-y: auto;
}

.filter-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.filter-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Filter Badges */
.filter-badge {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    background-color: #0d6efd !important; /* Bootstrap primary blue */
    color: white !important;
}

.filter-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-remove {
    text-decoration: none;
    margin-left: 0.25rem;
    transition: color 0.2s ease;
}

.filter-remove:hover {
    color: #dc3545 !important;
}

/* Detail Section */
.detail-section-card {
    border: none;
    border-radius: 0.5rem;
    height: 100%;
}

.selected-variant-container {
    min-height: 300px;
}

/* Quantity Controls */
.quantity-slider {
    width: 100%;
    height: 4px;
    cursor: pointer;
}

.quantity-slider::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    -webkit-appearance: none;
}

.quantity-slider::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    border: none;
}

.quantity-controls button {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-quantity {
    font-weight: bold;
    color: #0d6efd;
}

.quick-quantity:hover {
    color: #0a58ca;
}

.add-to-cart {
    transition: all 0.2s ease;
}

.add-to-cart:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

/* Summary Section */
.product-master-summary {
    border: none;
    border-radius: 0.5rem;
}

/* Summary Badges */
.product-master-summary .badge {
    background-color: #6c757d !important;
    color: white !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    width: 100%;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Variant Detail Badges */
.variant-detail-badge {
    background-color: #6c757d !important;
    color: white !important;
}

.variant-detail-content .badge {
    background-color: #6c757d !important;
    color: white !important;
}

/* Responsive Grid */
.variant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Loading State */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s linear infinite;
}

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

/* Responsive Breakpoints */
@media (max-width: 991px) {
    .variant-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .filter-section-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .filter-section-card .card-title {
        margin-bottom: 0;
    }

    .filter-section-card .btn-link {
        align-self: flex-end;
    }
}

@media (max-width: 576px) {
    .variant-list {
        max-height: 300px;
    }

    .filters-container {
        max-height: 300px;
    }
}

/* Price Tiers / Staffelpreise */
.price-tiers-section {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
}

.price-tiers-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
}

.price-tiers-table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

.price-tiers-table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* =============================================
   PRODUCT IMAGE PLACEHOLDER
   ============================================= */
.product-image-placeholder {
    height: 400px;
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 50%, #f48fb1 100%);
    border-radius: 0.75rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #ad1457;
    /* display controlled by inline style or JS */
}

.product-image-placeholder svg {
    opacity: 0.5;
    width: 80px;
    height: 80px;
}

.product-image-placeholder span {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* =============================================
   FILTER CHIPS (replaces select boxes)
   ============================================= */
.filter-chips-section {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e9ecef;
    background: #fafafa;
}

.filter-chip-group {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 60px;
}

.filter-chip-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.filter-chip {
    display: inline-flex !important;
    align-items: center !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding: 0.3rem 0.7rem !important;
    margin: 0 !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    border: 1.5px solid #dee2e6 !important;
    border-style: solid !important;
    border-radius: 50px !important;
    background: #fff !important;
    background-image: none !important;
    color: #495057 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    user-select: none !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    min-width: auto !important;
    min-height: auto !important;
}

.filter-chip:hover {
    border-color: #ce93d8 !important;
    background: #fce4ec !important;
    color: #880e4f !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(206, 147, 216, 0.2) !important;
}

.filter-chip.active {
    border-color: #ad1457 !important;
    background: linear-gradient(135deg, #f48fb1, #ec407a) !important;
    background-image: linear-gradient(135deg, #f48fb1, #ec407a) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(173, 20, 87, 0.25) !important;
}

.filter-chip.active:hover {
    background: linear-gradient(135deg, #ec407a, #d81b60) !important;
    background-image: linear-gradient(135deg, #ec407a, #d81b60) !important;
    border-color: #ad1457 !important;
}

/* Active filter badges (when filters are applied) */
.filter-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    background: linear-gradient(135deg, #f48fb1, #ec407a);
    color: #fff;
    cursor: default;
}

.filter-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    transition: background 0.2s;
}

.filter-chip-remove:hover {
    background: rgba(255,255,255,0.5);
}

.filter-reset-btn {
    font-size: 0.75rem;
    text-decoration: none;
    transition: color 0.2s;
}

.filter-reset-btn:hover {
    color: #ad1457 !important;
}

/* =============================================
   VARIANT CARD ITEMS (replaces list-group items)
   ============================================= */
.variant-grid-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem;
}

.variant-card-item {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1.5px solid #e9ecef !important;
    border-style: solid !important;
    border-radius: 0.6rem !important;
    margin-bottom: 0.5rem !important;
    background: #fff !important;
    overflow: hidden !important;
    position: relative !important;
    cursor: pointer !important;
    outline: none !important;
}

.variant-card-item:last-child {
    margin-bottom: 0;
}

.variant-card-inner {
    display: flex !important;
    align-items: center !important;
    padding: 0.7rem 0.85rem !important;
    gap: 0.75rem !important;
}

.variant-card-name {
    flex: 1 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #2d2d2d !important;
    line-height: 1.3 !important;
}

.variant-card-tags {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.variant-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    padding: 0.15rem 0.5rem !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    border-radius: 50px !important;
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
    white-space: nowrap !important;
}

.variant-tag-label {
    color: #9c27b0;
    opacity: 0.7;
    font-weight: 400;
}

.variant-tag-value {
    font-weight: 600;
}

.variant-card-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #66bb6a, #43a047);
    color: #fff;
    font-size: 0.75rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(67, 160, 71, 0.3);
}

/* Hover state */
.variant-card-item:hover {
    border-color: #ce93d8 !important;
    background: #fce4ec !important;
    box-shadow: 0 2px 12px rgba(206, 147, 216, 0.15) !important;
    transform: translateY(-1px) !important;
}

/* Active/Selected state */
.variant-card-item.active {
    border-color: #ad1457 !important;
    background: linear-gradient(135deg, #fce4ec, #f8bbd0) !important;
    box-shadow: 0 2px 12px rgba(173, 20, 87, 0.15) !important;
}

.variant-card-item.active .variant-card-name {
    color: #880e4f;
}

.variant-card-item.active .variant-tag {
    background: #e91e63;
    color: #fff;
}

.variant-card-item.active .variant-tag-label {
    color: rgba(255,255,255,0.8);
}

/* =============================================
   DETAIL SECTION BADGES (matching new design)
   ============================================= */
.variant-detail-content .badge {
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
    font-weight: 500;
    border-radius: 50px;
    padding: 0.3rem 0.7rem;
}

.variant-detail-badge {
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
}

/* =============================================
   ADD TO SELECTION BUTTON (pink gradient)
   ============================================= */
.add-to-selection {
    background: linear-gradient(135deg, #ec407a, #ad1457) !important;
    border: none !important;
    border-radius: 0.5rem;
    color: #fff !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(173, 20, 87, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-to-selection:hover {
    background: linear-gradient(135deg, #d81b60, #880e4f) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(173, 20, 87, 0.4);
}

.add-to-selection:active {
    transform: translateY(0);
}

/* =============================================
   ADD BUNDLE TO CART BUTTON
   ============================================= */
.add-all-to-cart {
    background: linear-gradient(135deg, #ec407a, #ad1457) !important;
    border: none !important;
    border-radius: 0.5rem;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(173, 20, 87, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-all-to-cart:hover {
    background: linear-gradient(135deg, #d81b60, #880e4f) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(173, 20, 87, 0.4);
}

/* =============================================
   SUMMARY SECTION STYLING
   ============================================= */
.product-master-summary {
    border: 1.5px solid #f8bbd0;
    box-shadow: 0 2px 12px rgba(233, 30, 99, 0.08);
}

.product-master-summary .card-header {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    border-bottom: 1px solid #f48fb1;
}

.product-master-summary #total-quantity {
    color: #ad1457 !important;
}

.product-master-summary #total-price {
    color: #2e7d32 !important;
}

/* Selection items */
.selection-item {
    border: 1px solid #f8bbd0;
    border-radius: 0.5rem;
    background: #fce4ec !important;
}

.selection-item .badge {
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
}

/* Clear button */
#clear-selection-btn {
    color: #ad1457;
    border-color: #f48fb1;
}

#clear-selection-btn:hover {
    background: #ad1457;
    color: #fff;
}

/* =============================================
   VARIANT DETAIL CHIPS
   ============================================= */
.variant-detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 50px;
    background: #f3e5f5;
    color: #7b1fa2;
}

.variant-detail-chip-label {
    opacity: 0.7;
    font-weight: 400;
}

.variant-detail-chip-value {
    font-weight: 600;
}

/* =============================================
   PRODUCT TITLE & HEADER
   ============================================= */
.product-view h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d2d2d;
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    margin: 0;
    letter-spacing: -0.02em;
}

.product-view h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #f48fb1, #ec407a, #ad1457);
    border-radius: 2px;
    margin: 0.75rem auto 0;
}

@media (min-width: 768px) {
    .product-view h1 {
        font-size: 2rem;
    }
}

/* Product master header */
.product-master-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a4a4a;
}

/* Card headers with new gradient */
.variant-list-card .card-header,
.detail-section-card .card-header {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0) !important;
    border-bottom: 1px solid #f48fb1;
}

.variant-list-card .card-title,
.detail-section-card .card-title {
    color: #ad1457;
    font-weight: 600;
}

/* Scrollbar styling for variant list */
.variant-grid-list::-webkit-scrollbar {
    width: 6px;
}

.variant-grid-list::-webkit-scrollbar-track {
    background: #f8bbd0;
    border-radius: 3px;
}

.variant-grid-list::-webkit-scrollbar-thumb {
    background: #ec407a;
    border-radius: 3px;
}

.variant-grid-list::-webkit-scrollbar-thumb:hover {
    background: #ad1457;
}

/* =============================================
   OUT OF STOCK STYLING
   ============================================= */
.variant-card-item.out-of-stock {
    opacity: 0.45 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
    position: relative;
}

.variant-card-item.out-of-stock:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #dee2e6 !important;
    background: #f8f9fa !important;
}

.variant-card-item.out-of-stock .variant-card-name {
    color: #6c757d !important;
    text-decoration: line-through;
}

.variant-card-item.out-of-stock .variant-tag {
    background: #e9ecef !important;
    color: #6c757d !important;
}

.variant-card-oos-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50px;
    background: #dc3545;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.variant-card-oos-badge i {
    font-size: 0.75rem;
}

/* =============================================
   PRODUCT MAIN IMAGE
   ============================================= */
.product-main-image-wrapper {
    position: relative;
}

.product-main-image-wrapper #product-main-image {
    transition: opacity 0.2s ease;
}

.product-main-image-wrapper #product-main-placeholder {
    display: flex;
}

/* =============================================
   PRODUCT THUMBNAIL GALLERY
   ============================================= */
.product-thumbnail-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.product-thumbnail {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.product-thumbnail:hover {
    opacity: 1;
    border-color: #adb5bd;
    transform: scale(1.05);
}

.product-thumbnail.active-thumbnail {
    border-color: #0d6efd;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}
