/* ProductAttributeViewer Module CSS */
#product-attribute-viewer {
    margin-top: 20px;
}


.pav-group-container {
    margin-bottom: 20px;
    padding: 10px;
    background: #fdfdfd;
    border: 1px solid #eaeaea;
    border-radius: 5px;
}

.pav-primary-group {
    background: #f7f9fc;
    border-color: #d1dce8;
}

.pav-group-container h4 {
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
}

.pav-attributes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pav-attribute-btn {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    font-size: 0.9rem;
    color: #333;
}

.pav-attribute-btn:hover {
    border-color: #999;
}

.pav-attribute-btn.pav-selected {
    border-color: #000;
    background-color: #f1f1f1;
    font-weight: bold;
    box-shadow: 0 0 0 2px #000;
}

.pav-attribute-btn.pav-display-color_image {
    width: 40px;
    height: 40px;
    padding: 0;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    display: inline-block;
}

.pav-attribute-btn.pav-display-color_text {
    background-size: cover;
    background-position: center;
    color: #333;
    font-weight: 500;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.8), 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Base rule: Impossible combinations can still be clicked to trigger PrestaShop auto-fallback */

/* CROSS (Croix) */
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-unavailable,
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-out-of-stock {
    opacity: 0.6;
    position: relative;
    overflow: hidden;
}
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-unavailable::before,
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-unavailable::after,
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-out-of-stock::before,
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 1px;
    background-color: #d9534f;
    z-index: 1;
}
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-unavailable::before,
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-out-of-stock::before {
    transform: rotate(35deg);
}
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-unavailable::after,
#product-attribute-viewer[data-pav-unavailable-style="cross"] .pav-out-of-stock::after {
    transform: rotate(-35deg);
}

/* STRIKETHROUGH (Barré) */
#product-attribute-viewer[data-pav-unavailable-style="strikethrough"] .pav-unavailable,
#product-attribute-viewer[data-pav-unavailable-style="strikethrough"] .pav-out-of-stock {
    opacity: 0.5;
    text-decoration: line-through;
    color: #999;
}

/* GRAYED OUT (Grisé) */
#product-attribute-viewer[data-pav-unavailable-style="grayed"] .pav-unavailable,
#product-attribute-viewer[data-pav-unavailable-style="grayed"] .pav-out-of-stock {
    opacity: 0.4;
    background-color: #f5f5f5;
    color: #aaa;
    border-color: #ddd;
    text-decoration: none;
}

.pav-emailalerts-container {
    margin-top: 15px;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    text-align: center;
}

.pav-oos-message {
    color: #856404;
    font-weight: 600;
    margin-bottom: 10px;
}

.pav-notify-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.pav-notify-btn:hover {
    background-color: #0056b3;
}

/* Hide native ps_emailalerts messages so our custom text is the only one visible */
.pav-emailalerts-container .js-mailalert p,
.pav-emailalerts-container .js-mailalert div:not(.alert):not(.form-group):not(.pav-notify-btn-wrapper),
.pav-emailalerts-container .mailalerts p,
.pav-emailalerts-container .mailalerts div:not(.alert):not(.form-group):not(.pav-notify-btn-wrapper) {
    display: none !important;
}
