/* Lien */

.other-color-link,
.swatch-request-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--secondary);
    text-decoration: underline;
    width: fit-content;
    margin: 0 auto;
}

.other-color-link {
    margin-top: 20px;
}

.other-color-link::before {
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="17.17" height="17.17" viewBox="0 0 17.17 17.17"><g id="Icon_feather-zoom-out" data-name="Icon feather-zoom-out" transform="translate(-4 -4)"><path id="Tracé_53050" data-name="Tracé 53050" d="M18.689,11.595A7.095,7.095,0,1,1,11.595,4.5a7.095,7.095,0,0,1,7.095,7.095Z" fill="none" stroke="%23178fb8" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path id="Tracé_53051" data-name="Tracé 53051" d="M28.833,28.833l-3.858-3.858" transform="translate(-8.37 -8.37)" fill="none" stroke="%23178fb8" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></svg>');
    line-height: 0;
}

.other-color-link:hover,
.swatch-request-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Overlay */

.swatch-panel-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

/* Panneau slide-in */
.swatch-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 600px;
    max-width: 100%;
    background-color: #fff;
    z-index: 1050;
    transition: translate 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    translate: 100% 0;
    padding: 35px 45px 20px 45px;
    gap: 30px;
}

.swatch-panel.active {
    translate: 0 0;
}

/* Header du panneau */
.swatch-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.swatch-panel-header .title {
    margin: 0;
    font-family: "sofia-pro", sans-serif;
    font-size: 20px;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--secondary);
}

.swatch-panel-header .close {
    opacity: 1;
}

/* Corps du panneau */
.swatch-panel-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* Items nuances */
.swatch-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.swatch-preview {
    width: 35px;
    height: 35px;
    margin-bottom: 0;
}

.swatch-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.swatch-info {
    display: flex;
    flex-direction: column;
}

.swatch-code {
    font-size: 0.875rem;
    color: #6c757d;
}

.product-swatch-container {
    height: 100%;
    overflow: auto;
}

.product-swatch-container .tabs {
    margin-top: 0;
    padding: 0;
}
.product-swatch-container .nav-tabs {
    margin-bottom: 1.5rem;
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--lightblue);
}

.product-swatch-container .nav-tabs .nav-item {
    float: none;
}

.product-swatch-container .nav-tabs .nav-link {
    text-transform: uppercase;
    font-weight: 600;
    padding-bottom: 13px;
    color: var(--secondary);
}

.product-swatch-container .nav-tabs .nav-link.active,
.product-swatch-container .nav-tabs .nav-link:hover {
    color: var(--primary);
    border-bottom: 0;
}

.swatch-type .type-header {
    margin-bottom: 30px;
    position: relative;
}

.type-description {
    font-size: 0.875rem;
    font-style: italic;
}

.swatch-type .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 40px;
    row-gap: 30px;
}

.swatch-image {
    width: 100%;
    aspect-ratio: 1/0.7;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.swatch-image button {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0 0 0 / 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 0;
    opacity: 0;
    cursor: pointer;
    transition: opacity .3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.swatch-image:hover button {
    opacity: 1;
}

.swatch-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

[id^="swatch-image-popover-"]::backdrop {
    background-color: rgba(0 0 0 / 0.5);
}

.swatch-name {
    font-weight: 400;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 0;
}

.swatch-name + .text-muted {
    font-size: 14px !important;
    color: black !important;
}

.btn-link {
    color: #2fb5d2;
    text-transform: uppercase;
    font-weight: 600;
    font-size: .875rem;
    padding: 0;
}

.btn-link:hover {
    color: #208094;
    text-decoration: none;
}

.btn-link .material-icons {
    font-size: 1.25rem;
    vertical-align: middle;
    margin-right: .25rem;
}

/* Fix for tab content visibility */
.tab-content > .tab-pane {
    display: none;
}

.tab-content > .active {
    display: block;
    opacity: 1;
}

/* Ensure smooth transition */
.fade {
    opacity: 0;
    transition: opacity .15s linear;
}


.color-selector {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-block;
    margin: 5px;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-selector.selected {
    border-color: #007bff;
}

.material-selector {
    border: 1px solid #dee2e6;
    padding: 8px 15px;
    margin: 5px;
    display: inline-block;
    cursor: pointer;
    border-radius: 4px;
}

.material-selector.selected {
    background-color: #007bff;
    color: white;
}

@media (max-width: 767.98px) {
    .type-header .row {
        flex-direction: column;
    }

    .type-description {
        margin-top: 0.5rem;
    }
}

/* Styles des onglets de matériaux */
.swatch-tabs {
    display: flex;
    margin: 30px 0;
    border-bottom: 1px solid var(--lightblue);
    overflow: auto;
}

.swatch-tab {
    padding: 14px;
    background: transparent;
    border: none;
    color: var(--secondary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swatch-tab:hover,
.swatch-tab:focus,
.swatch-tab.active {
    color: var(--primary);
}

.swatch-tab:focus {
    outline: none;
}

/* Conteneur des nuances */
.swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 35px);
    gap: 12px;
    margin: 15px 0;
}

/* Style des sélecteurs de nuances */
.swatch-selector {
    position: relative;
}

.swatch-selector input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.swatch-preview {
    display: block;
    position: relative;
    border-radius: 8px;
    border: 1px solid var(--secondary);
    cursor: pointer;
    overflow: hidden;
}

.swatch-selector input[type="checkbox"]:checked + .swatch-preview {
    border: 2px solid white;
    outline: 2px solid var(--secondary);
}

.swatch-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swatch-info {
    margin-top: 0.5rem;
    text-align: center;
}

.swatch-code {
    display: block;
    font-size: 0.75rem;
    color: #7a7a7a;
}

/* Affichage du code et de la couleur sélectionnée */
.selected-swatch-info {
    margin-bottom: 14px;
    color: var(--secondary);
    display: none;
}

.selected-swatch-info.visible {
    display: block;
}

/* Swatch footer */
.swatch-footer {
    padding-top: 25px;
    border-top: 1px solid var(--lightblue);
}

.swatch-footer a {
    text-transform: uppercase;
    text-decoration: underline;
    color: var(--secondary);
}

.swatch-footer a + a {
    padding-left: 15px;
    margin-left: 15px;
    border-left: 1px solid var(--secondary);
}

.d-none {
    display: none;
}

/* Modal swatch */

.modal-swatch {
    background-color: rgba(0 0 0 / 0.5);
}

.modal-swatch .modal-content {
    position: relative;
    width: 600px;
    max-width: 100%;
    padding: 70px 50px;
    border-radius: 8px;
    border: 1px solid var(--lightblue);
}

.modal-swatch .modal-content .close {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 1;
}

.modal-swatch .modal-header,
.modal-swatch .modal-body {
    padding: 0;
    border: 0;
}

.modal-swatch .modal-title {
    font-size: 20px;
    font-weight: 400;
    color: var(--secondary);
    margin-top: 0;
    margin-bottom: 15px;
}

.modal-swatch .modal-body .description {
    color: black;
    margin: 0;
}

.swatch_form .form-group {
    display: grid;
    width: 400px;
    max-width: 100%;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 30px;
    row-gap: 15px;
}

.swatch_form .form-title {
    font-weight: 700;
    color: var(--secondary);
    grid-column: 1/3;
}

.swatch_form .form-group input[name="address"] {
    grid-column: 1/3;
}

/* Responsive */
@media (max-width: 768px) {
    .swatch-tabs {
        flex-wrap: wrap;
    }

    .swatch-tab {
        flex: 1 1 auto;
        text-align: center;
        padding: 8px 12px;
    }
}

@media (max-width: 600px) {
    .swatch-type .grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 30px;
        row-gap: 20px;
    }
}

@media (max-width: 575px) {
    .swatch-panel {
        padding: 30px 20px 20px 20px;
    }

    .swatch-panel-header .title {
        font-size: 18px;
    }

    .swatch-footer {
        padding-top: 20px;
    }

    .swatch-footer a {
        display: block;
    }

    .swatch-footer a + a {
        padding-left: 0;
        margin-left: 0;
        margin-top: 15px;
        border: 0;
    }

    .modal-swatch .modal-content {
        padding: 45px 30px;
    }

    .swatch_form .form-group {
        grid-template-columns: 1fr;
    }

    .swatch_form .form-title,
    .swatch_form .form-group input[name="address"] {
        grid-column: 1;
    }
}