/* Ukryj przewijanie strony i zablokuj kliknięcia */
body.modal-open {
    overflow: hidden;
}

/* Modal backdrop */
.modal-backdrop {
    display: none;  /* Początkowo ukryte */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Przezroczyste tło pod modalem */
    z-index: 1000;
    opacity: 0;  /* Początkowo przezroczyste */
    transition: opacity 0.3s ease;  /* Animacja zmiany przezroczystości */
}

/* Pokaż backdrop */
.modal-backdrop.show {
    display: block;
    opacity: 1;
}

/* Modal container */
.custom-modal {
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;  /* Ustawienie wyższego z-index dla nad modalem z tkaninami */
    position: fixed;
    margin: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Modal content */
.custom-modal-content {
    max-height: 80vh;
    overflow: auto;
    border-radius: 8px;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    position: relative;
    flex-direction: row-reverse;
    align-items: flex-start;
    justify-content: space-between;
}

/* Show modal */
.custom-modal.show {
    display: block;
    opacity: 1;
}

/* Show modal content */
.custom-modal.show .custom-modal-content {
    opacity: 1;
}

/* Close button */
.custom-modal .close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.custom-modal .close:hover,
.custom-modal .close:focus {
    color: black;
    text-decoration: none;
}

.modal-body {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.modal-body-header > h2 {
    margin-top: 0;
}

.modal-body-content {
    display: flex;
    flex-direction: column;
}

.modal-body-content-selector {
    display: flex;
}

.modal-select {
    height: 3.5rem;
    margin-right: 2em;
    padding: .9rem 1.1rem;
    font-size: var(--wp--preset--font-size--small);
}

.modal-select-group-price {
    display: none;
    flex-direction: column;
}

.modal-select-group-price > label {
    margin: 0;
}

.group-price-textbox {
    border: none;
    font-family: var(--wp--preset--font-family--afacad);
    font-size: clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.34), 1.1rem);
    font-style: normal;
    font-weight: 400;
}

.fabric-group h3 {
    margin-bottom: 0;
}

.fabrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1em;
		justify-items: center;
}

.fabric-item {
    width: 100%;
    height: 100px;
    background-size: cover;
    background-position: center;
    position: relative;
    margin: 10px;
    display: inline-block;
    text-align: center;
    overflow: hidden;
    border-radius: 1.3em;
    cursor: pointer;
    transition: box-shadow 0.1s, border-color 0.3s;
}

.fabric-item:hover {
    /* border: 2px solid #007cba; */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.fabric-item .zoom-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 25%;
    left: 75%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 50%;
}

.fabric-item .zoom-icon svg {
    width: 70%;
    height: 100%;
}

.zoom-icon {
    position: absolute;
    width: 24px;
    top: 10px;
    left: 10px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: border 0.2s ease-in-out;
}

.zoom-icon:hover {
    border: 2px solid white;
}

.zoom-icon svg {
    width: 100%;
    height: 100%;
}

.fabric-item-zoom {
    position: absolute;
    color: white;
    z-index: 99;
    right: 1em;
    top: .3em;
    cursor: pointer;
}

.fabric-item-zoom:hover {
    color: red;
}

.preview-modal-backdrop {
    display: none;  /* Początkowo ukryte */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Bardziej intensywne przezroczyste tło pod modalem */
    z-index: 1051;  /* Ustawienie wyższego z-index dla nad modalem z tkaninami */
    opacity: 0;  /* Początkowo przezroczyste */
    transition: opacity 0.3s ease;  /* Animacja zmiany przezroczystości */
}

/* Pokaż backdrop */
.preview-modal-backdrop.show {
    display: block;
    opacity: 1;
}

.preview-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1052;  /* Ustawienie wyższego z-index dla nad modalem z tkaninami */
    width: 20vw;
    height: 20vw;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border-radius: 2em;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9); /* Przezroczyste tło pod modalem */
}

@media only screen and (max-width: 758px) {
    .custom-modal-content {
        width: 85vw;
    }

    .fabric-item {
        height: 80px;
    }

    .preview-modal {
        width: 80vw;
        height: 80vw;
    }
    
    .preview-modal .close-button {
        width: 3em;
        height: 3em;
    }
    
    .close-button svg {
        width: 2em;
        height: 2em;
    }
}

.preview-modal img {
    display: block;
    width: 100%;
    height: 100%;
}

.preview-modal .close-button {
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: 50%;
    width: 4em;
    height: 4em;
}

.preview-modal .close-button svg {
    transition: transform 0.1s ease;
}

.preview-modal .close-button:hover svg {
    transform: rotate(180deg);
}

.preview-modal-header {
    display: flex;
    position: absolute;
    height: 4em;
    align-items: center;
    justify-content: space-between;
    align-content: center;
    width: 100%;
}

.preview-modal-header span {
    justify-content: flex-end;
    color: white;
    padding: 2px 1em;
    margin: 1em 0 0 1em;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: .33em;
    font-size: calc(3.5em / 2);
}

.close-button {
    margin: 1em 1em 0 0;
}

.close-button svg {
    width: 3em;
    height: 3em;
}

/* Additional styles for img-item */
.img-item {
    max-width: 80px;
    height: 80px;
    overflow: clip;
}

.img-item.rounded {
    border-radius: 1em;
}

.img-item.responsive img {
    width: 100%;
    height: 100%;
    display: block;
}

.fabric-preview-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.fabric-preview-modal-content {
    margin: 15% auto;
    padding: 20px;
    width: 80%;
    max-width: 700px;
}

.fabric-preview-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.fabric-preview-close:hover,
.fabric-preview-close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

#fabric-preview-image {
    width: 100%;
    height: auto;
}

.image-container {
		position: relative;
		display: inline-block;
}

.image-container img {
		display: block;
		width: 100%;
		height: auto;
}

.image-container .image-text {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		color: white;
		font-size: 20px;
		background-color: rgba(0, 0, 0, 0.5); /* Półprzezroczyste tło */
		padding: 5px;
		border-radius: 5px;
}

.tail-title-single-page {
	position: relative;
	top: -2.6em;
	text-align: center;
	color: white;
	background-color: rgba(0, 0, 0, 0.5); /* Półprzezroczyste tło */
    font-size: 0.85em;
}
#selected-fabric-container{
    margin-bottom: 15px;
}
#open-modal{
    margin-bottom: 10px;
}