/* Paint Selector Button Styles */
.paint-selector-button-wrapper {
    margin: 10px 0;
}

.paint-selector-btn {
    background-color: #dd3333 !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

.paint-selector-btn:hover {
    background-color: #b82525 !important;
}

/* Paint Selector Popup Styles */
.paint-selector-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.paint-selector-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.paint-selector-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    height: 90vh;
    overflow: hidden;
}

.paint-selector-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
}

.paint-selector-popup-header h3 {
    margin: 0;
    color: #333;
}

.paint-selector-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paint-selector-close:hover {
    color: #333;
}

.paint-selector-popup-body {
    display: flex;
    min-height: 400px;
}

.paint-selector-left {
    flex: 1;
    padding: 20px;
    border-right: 1px solid #eee;
    background-color: #fafafa;
}

.paint-selector-right {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(90vh - 62px);
}

.color-preview-box {
    text-align: center;
}

.color-preview-display {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 20px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    transition: background-color 0.3s ease;
    position: relative;
}

.color-preview-display.customColor{
    background: url('../images/ingen-forhaandsvisning.png') no-repeat top center;
    background-size: cover;
}

.color-preview-display-thumbnails{
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.color-preview-display-thumbnail{
    border-radius: 4px;
    overflow: hidden;
    width: 100px;
    background: #fff;
    box-shadow: 0 1px 5px #000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-preview-display-thumbnail:hover,
.color-preview-display-thumbnail.active{
    box-shadow: 0 7px 15px #000;
}

.color-preview-display-thumbnail img{
    width: 100px;
    height: auto;
    display: block;
}

.color-preview-info {
    text-align: center;
    display: flex;
    gap: 10px;
}

.paint-selector-left .color-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #333;
    flex: 1;
    padding: 9px 19px;
    border-radius: 4px;
    line-height: 1.5em;
    border: 1px solid #ddd;
}

.paint-selecter-button {
    padding: 0;
    flex: 1;
}

.paint-selecter-button button {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    display: block;
    text-align: center;
    width: 100%;
    line-height: 1.5em;
}

.paint-selecter-button button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loader {
  border: 4px solid #1C3B5B;
  border-top: 4px solid #AEB521;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

.category-filters {
    margin-bottom: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.category-filter-btn {
    display: block;
    text-align: center;
    padding: 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.category-filter-btn .category-color-icon{
    width: 50px;
    height: 50px;
    border-radius: 25px;
    display: block;
    margin: 0 auto 5px;
    border: 1px solid #ddd;
}

.category-filter-btn:hover {
    background-color: #e0e0e0;
}

.category-filter-btn.active {
    background-color: #e0e0e0;
}

.color-search{
    margin-bottom: 10px;
    flex: 0 0 auto
}

.color-search input[type="text"]{
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    height: 40px;
    line-height: 40px;
    padding: 0 15px;
    font-size: 16px;
    box-shadow: none;
}

.color-list{
    overflow-y: auto;
    flex: 1;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 5px;
}

.color-item {
    text-align: center;
    cursor: pointer;
    padding: 0px;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

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

.color-item.active{
    background: #ddd;
}

.color-swatch {
    width: 100%;
    height: 100px;
    margin: 0 auto 8px;
    border-radius: 5px 5px 0 0;
    transition: transform 0.3s ease;
}

.color-name {
    padding: 0 10px;
    font-size: 14px;
    color: #333;
    margin: 0;
    line-height: 1.2;
    word-wrap: break-word;
}

.color-chart{
    padding: 0 10px 10px;
    font-size: 12px;
    margin: 0;
    line-height: 1.2;
}

/* Product Selection View Styles */
.product-selection-view {
    padding: 20px;
    min-height: 400px;
}

.product-selection-layout {
    display: flex;
    gap: 30px;
    min-height: 400px;
}

.product-selection-left {
    flex: 1;
}

.product-selection-left h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 16px;
}

.product-selection-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Products List Styles */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.product-row:hover {
    border-color: #dd3333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.add-product-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #dd3333;
    background-color: #dd3333;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.add-product-btn:hover {
    background-color: #b82525;
    border-color: #b82525;
    color: #fff;
    transform: scale(1.1);
}

.plus-icon {
    line-height: 1;
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #ddd;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.no-thumbnail {
    color: #999;
    font-size: 12px;
    text-align: center;
}

.product-info {
    flex: 1;
}

.product-name {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.product-price {
    color: #dd3333;
    font-weight: bold;
    font-size: 14px;
}

/* Overview Section Styles */
.overview-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
    padding: 20px;
}

.overview-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.selected-products {
    min-height: 100px;
}

.no-selections {
    color: #999;
    font-style: italic;
    text-align: center;
    margin: 40px 0;
}

.selected-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.selected-product-item:last-child {
    margin-bottom: 0;
}

.selected-product-item .product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.selected-product-item .product-name {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.selected-product-item .product-price {
    color: #dd3333;
    font-size: 12px;
    font-weight: 600;
}

.selected-product-item .product-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-product-item .product-quantity {
    color: #666;
    font-size: 12px;
    margin: 0;
}

.selected-product-item .item-total {
    color: #dd3333;
    font-size: 12px;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.remove-product-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #dc3545;
    background-color: #dc3545;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.remove-product-btn:hover {
    background-color: #c82333;
    border-color: #c82333;
    transform: scale(1.1);
    color: #fff;
}

.minus-icon {
    line-height: 1;
}

/* Total Price Section */
.total-price-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #dd3333;
}

.total-price {
    text-align: right;
    font-size: 18px;
    color: #333;
}

.total-price strong {
    color: #dd3333;
}

/* Paint Color Display Styles */
.paint-color-info {
    margin: 10px 0;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-left: 3px solid #dd3333;
    border-radius: 4px;
    font-size: 14px;
}

.paint-color-info strong {
    color: #dd3333;
}

.paint-color-email-info {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.paint-color-email-info strong {
    color: #dd3333;
}

/* Cart and Checkout Paint Color Display */
.woocommerce-cart-item__paint-color,
.woocommerce-checkout-review-item__paint-color {
    font-size: 12px;
    color: #dd3333;
    font-weight: 600;
    margin-top: 5px;
}

/* Order Details Paint Color */
.woocommerce-order-item__paint-color {
    margin: 8px 0;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-left: 3px solid #dd3333;
    border-radius: 4px;
    font-size: 13px;
}

.woocommerce-order-item__paint-color strong {
    color: #dd3333;
}

/* Selected Color Summary */
.selected-color-summary {
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
    padding: 20px;
}

.selected-color-summary h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.selected-color-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.color-swatch-large {
    width: 80px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.color-info {
    flex: 1;
}

.color-name-large {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.color-hex-large {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-family: monospace;
}

/* Cart Actions */
.cart-actions {
    text-align: center;
}

.add-all-to-cart {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
}

.add-all-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.paint-selector-back-btn {
    background: none;
    border: none;
    color: #dd3333;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 14px;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.paint-selector-back-btn:hover {
    color: #b82525;
}

.custom-color-button{
    margin-top: 10px;
    width: 100%;
    text-align: center;
    background: #000;
    color: #fff;
    transition: background-color 0.2s ease;
}

.custom-color-button:hover{
    background: #b82525;
    color: #fff;
}

#customColorOverlay{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
}

#customColorDialog{
    width: 100%;
    max-width: 600px;
    padding: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

#customColorDialog h4{
    margin: 0 0 12px;
    line-height: 1em;
    font-weight: 700;
    color: #000;
}

#customColorDialog p{
    margin: 0 0 1em;
    color: #000;
    font-size: 15px;
    line-height: 1.4em;
}

#customColorInput{
    width: 100%;
    padding: 0 15px;
    border-radius: 4px;
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    color: #000;
    border: 1px solid #ddd;
    background: #fff;
    margin-bottom: 20px;
}

.customColorButtons{
    display: flex;
    gap: 12px;
}

.customColorBtn{
    display: block;
    padding: 0 30px;
    color: #fff;
    height: 40px;
    line-height: 40px;
    border-radius: 4px;
    text-align: center;
}

.customColorBtn:hover{
    color: #fff;
}

#customColorOkBtn{
    background: #004400;
}

#customColorCancelBtn{
    background: #440000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .paint-selector-popup-header{
        padding: 5px 10px;
    }

    .paint-selector-popup-content {
        width: 95%;
        height: 95vh;
    }
    
    .paint-selector-popup-body {
        flex-direction: column;
    }
    
    .paint-selector-left {
        border-right: none;
        border-bottom: none;
        padding: 10px 10px 0;
    }

    .color-preview-display{
        margin-bottom: 10px;
    }

    .paint-selector-right{
        padding: 10px;
        flex: none;
        height: calc(95vh - 400px);
    }

    .category-filters{
        gap: 0;
        justify-content: space-between;
    }

    .category-filter-btn{
        line-height: 0;
        font-size: 0;
        padding: 0;
        border-width: 0;
    }

    .category-filter-btn .category-color-icon{
        width: 34px;
        height: 34px;
        margin: 0;
    }
    
    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
    
    .color-swatch{
        height: 60px;
    }

    .product-selection-layout {
        flex-direction: column;
        gap: 10px;
    }
    
    .product-selection-view{
        padding: 10px;
        height: calc(95vh - 52px);
        overflow-y: scroll;
    }
    
    .products-list{
        gap: 10px;
    }
    
    .product-row {
        gap: 10px;
        padding: 10px 15px;
    }
    
    .product-thumbnail {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }
    
    .overview-section,
    .selected-color-summary{
        padding: 10px;
    }
    
    .overview-section h4,
    .selected-color-summary h4{
        margin-bottom: 8px;
        font-weight: 700;
    }
    
    .selected-product-item {
        gap: 10px;
    }
    
    .selected-product-item .product-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .selected-product-item .product-quantity {
        margin: 0;
    }
    
    .product-selection-right{
        gap: 10px;
    }
    
}
/* ===== Kompakt produktvisning ("Vælg mængde og antal") ===== */
/* Klassen ps-products-mode sættes af script.js når produktvisningen åbnes */
.paint-selector-popup-content.ps-products-mode {
    width: min(1040px, 94%);
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.ps-products-mode .product-selection-view {
    min-height: 0;
    height: auto;
    padding: 24px;
    overflow-y: auto;
}

.ps-products-mode .product-selection-layout {
    min-height: 0;
    align-items: flex-start;
}

.ps-products-mode .selected-products {
    min-height: 0;
}

.ps-products-mode .no-selections {
    margin: 12px 0;
}

/* CTA: rød = klar, grå = deaktiveret (matcher shoppens pill-knapper) */
#paint-selector-popup .add-all-to-cart {
    background-color: #dd3333;
    color: #fff;
    border: none;
    border-radius: 35px;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease;
}

#paint-selector-popup .add-all-to-cart:hover:not(:disabled),
#paint-selector-popup .add-all-to-cart:focus:not(:disabled) {
    background-color: #b82525;
    color: #fff;
}

#paint-selector-popup .add-all-to-cart:disabled {
    background-color: #e5e5e5;
    color: #999;
    opacity: 1;
    cursor: not-allowed;
}

/* Besked når ingen varianter er tilgængelige */
.ps-empty-message {
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #333;
}

.ps-empty-message p {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.5;
}

.ps-empty-message p:last-child {
    margin-bottom: 0;
}

.ps-empty-message a {
    color: #dd3333;
    font-weight: 600;
}
