/* Rug Finder Popup Styling */
#rug-finder-popup-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.rug-finder-popup-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    width: 1000px;
    max-width: 95%;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: left;
    overflow: hidden;
}

.rug-popup-body {
    display: flex;
    flex-wrap: nowrap;
    min-height: 500px;
}

/* LEFT SIDE - IMAGE */
.rug-popup-left {
    flex: 0 0 50%;
    width: 50%;
    position: relative;
    overflow: hidden;
}

.rug-popup-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* RIGHT SIDE - CONTENT */
.rug-popup-right {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    box-sizing: border-box;
}

/* LOGO */
.rug-popup-logo {
    margin-bottom: 25px;
}

.rug-popup-logo img {
    max-width: 180px;
    height: auto;
}

/* HEADINGS & TEXT */
.rug-popup-right h2 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    color: #333;
    margin-bottom: 20px;
    text-transform: none;
    letter-spacing: 0.3px;
    max-width: 100%;
}

.rug-popup-right p {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
    max-width: 100%;
}

/* ACTION BUTTON */
.action.primary.btn-rug-finder {
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 14px 25px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border-radius: 0;
    /* Square button */
}

.action.primary.btn-rug-finder:hover {
    background-color: #fff;
    color: #000;
}

/* CLOSE BUTTON */
.close-rug-popup {
    color: #000;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 20px;
    /* Smaller, cleaner X */
    font-weight: normal;
    background: transparent;
    border: none;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
}

.close-rug-popup:hover {
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rug-popup-body {
        flex-direction: column;
    }

    .rug-popup-left,
    .rug-popup-right {
        width: 100%;
        flex: none;
    }

    .rug-popup-left {
        height: 250px;
    }

    .rug-popup-right {
        padding: 30px;
    }
}


/* Rug Finder Form Popup Styling */
#rug-finder-form-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.rug-finder-form-content {
    background-color: #fff;
    margin: auto;
    padding: 30px 40px;
    width: 700px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.close-rug-form-popup {
    color: #000;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: normal;
    background: transparent;
    border: none;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
}

.close-rug-form-popup:hover {
    opacity: 0.7;
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* Size Unit Toggle */
.size-unit-toggle {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.size-unit-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.size-unit-toggle input[type="radio"] {
    margin-right: 8px;
}

/* Size Inputs */
.size-inputs {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    justify-content: center;
}

.input-group {
    flex: 1;
    max-width: 250px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.input-wrapper {
    display: flex;
    gap: 10px;
}

.size-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.size-input-full {
    width: 100%;
}

/* Room Type Section */
.room-type-section {
    margin-bottom: 30px;
}

.room-type-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.room-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.room-option {
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.room-option:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.room-option.selected {
    border-color: #007bff;
    background-color: #f0f8ff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.room-image {
    width: 100%;
    height: 60px;
    margin-bottom: 5px;
    overflow: hidden;
    border-radius: 4px;
}

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

.room-option span {
    display: block;
    font-size: 11px;
    color: #333;
    font-weight: 500;
    padding: 2px 0;
}

/* Shape Section */
.shape-section {
    margin-bottom: 30px;
}

.shape-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

/* Additional Options Section */
.additional-options-section {
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.option-row {
    display: flex;
    gap: 40px;
    justify-content: space-between;
    align-items: flex-start;
}

.option-group {
    flex: 1;
}

.option-group h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: left;
    color: #666;
}

.radio-group {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.radio-option input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.radio-option span {
    user-select: none;
}

.shape-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.shape-option {
    text-align: center;
    cursor: pointer;
    padding: 8px 5px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.shape-option:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.shape-option.selected {
    border-color: #007bff;
    background-color: #f0f8ff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.shape-option.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.shape-option.disabled:hover {
    border-color: #e0e0e0;
    box-shadow: none;
}

.shape-option.disabled .shape-icon img {
    filter: grayscale(100%);
    opacity: 0.3;
}

.shape-option.disabled span {
    color: #ccc;
}

.shape-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.shape-option:hover .shape-icon img,
.shape-option.selected .shape-icon img {
    filter: grayscale(0%);
    opacity: 1;
}

.shape-option span {
    display: block;
    font-size: 10px;
    color: #333;
    font-weight: 500;
}

/* Color Section - Select a Color */
.color-section {
    margin-bottom: 30px;
}

.color-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.color-option {
    text-align: center;
    cursor: pointer;
    padding: 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: #fff;
    overflow: hidden;
    position: relative;
}

.color-option:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.color-option.selected {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.color-option.selected::after {
    content: "\2713";
    position: absolute;
    top: 4px;
    left: 6px;
    width: 18px;
    height: 18px;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    z-index: 1;
}

.color-swatch {
    display: block;
    width: 100%;
    height: 36px;
    min-height: 36px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.color-label {
    display: block;
    font-size: 10px;
    color: #333;
    font-weight: 500;
    padding: 4px 4px 6px;
    line-height: 1.2;
}

/* Rug Type Section */
.rug-type-section {
    margin-bottom: 30px;
    display: none; /* Hidden by default, shown by JS on page 3 */
}

.rug-type-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.rug-type-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.rug-type-option {
    text-align: center;
    cursor: pointer;
    padding: 8px 5px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.rug-type-option:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.rug-type-option.selected {
    border-color: #007bff;
    background-color: #f0f8ff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.rug-type-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rug-type-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.rug-type-option:hover .rug-type-icon img,
.rug-type-option.selected .rug-type-icon img {
    filter: grayscale(0%);
    opacity: 1;
}

.rug-type-option span {
    display: block;
    font-size: 10px;
    color: #333;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px 0;
}

.btn-prev,
.btn-next {
    background-color: transparent;
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 0;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.btn-prev:hover,
.btn-next:hover {
    color: #000;
}

.btn-prev:disabled,
.btn-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 14px;
    font-weight: 400;
    color: #333;
    min-width: 60px;
    text-align: center;
}

.page-indicator .current-page {
    font-weight: 600;
}

.page-indicator .divider {
    margin: 0 8px;
    color: #999;
}

.page-indicator .total-pages {
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .room-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shape-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .rug-type-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .size-inputs {
        flex-direction: column;
    }

    .input-group {
        max-width: 100%;
    }

    .option-row {
        flex-direction: column;
        gap: 20px;
    }

    .option-group h3 {
        font-size: 13px;
    }
}
