/* Configurator Parts Container */
#configurator-parts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    width: 100%;
}

.row-cols-lg-5>* {
    width: 100%;
}

/* Desktop layout specific styles */
@media (min-width: 992px) {
    /* Force visibility for desktop layout elements */
    .configurator-controls-column .configurator-measurements-block,
    .configurator-controls-column .configurator-settings-block,
    .configurator-controls-column .configurator-extras-block,
    .configurator-controls-column .configurator-name-embroidery-block,
    .configurator-controls-column .configurator-extra-embroidery-block {
        display: block !important;
        visibility: visible !important;
    }

    /* Container adjustments */
    .configurator-controls-column .container-fluid {
        padding: 0 15px;
    }

    /* Pre-designed section display - removed override to allow JavaScript control */
}

/* Allow dynamic tab content visibility control */

/* Custom Predesign Tabs */
.custom-predesign-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.custom-tab-item {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

.custom-tab-item:hover {
    border-color: #af282e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(175, 40, 46, 0.15);
}

.custom-tab-item.active {
    background: #af282e;
    border-color: #af282e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(175, 40, 46, 0.3);
}

.custom-tab-item .tab-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
    color: #333 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.custom-tab-item.active .tab-name {
    color: white !important;
}

.custom-tab-item .tab-price {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
    color: #666;
}

.custom-tab-item.active .tab-price {
    opacity: 1;
    color: rgba(255, 255, 255, 0.9);
}

/* Ensure tab content is visible */
.custom-tab-content {
    width: 100%;
    display: block !important;
    visibility: visible !important;
}

.custom-tab-content .tab-name,
.custom-tab-content .tab-price {
    display: block !important;
    visibility: visible !important;
}

/* Predesign Cards */
.predesign-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.predesign-card:hover {
    border-color: #af282e;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(175, 40, 46, 0.2);
}

.predesign-item.selected .predesign-card {
    border-color: #af282e;
    background: #fff8f8;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(175, 40, 46, 0.3);
}

.predesign-item.selected .predesign-card::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #af282e;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

.predesign-image {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.predesign-image img {
    width: 100%;
    /* height: 200px; */
    object-fit: contain;
    transition: transform 0.3s ease;
}

.predesign-card:hover .predesign-image img {
    transform: scale(1.05);
}

.predesign-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(175, 40, 46, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.predesign-card:hover .predesign-overlay {
    opacity: 1;
}

.predesign-overlay i {
    color: white;
    font-size: 24px;
}

.predesign-info {
    padding: 5px 15px;
    text-align: center;
}

.predesign-code {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.predesign-price {
    font-size: 14px;
    font-weight: 600;
    color: #af282e;
    background: rgba(175, 40, 46, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.predesign-category {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Canvas container adjustments for different image orientations */
#configurator-image-block-inner {
    transition: all 0.3s ease;
}

/* Portrait image handling */
#configurator-image-block-inner.portrait-mode {
    min-height: 600px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Landscape image handling */
#configurator-image-block-inner.landscape-mode {
    min-height: auto !important;
    display: block !important;
}

/* Square image handling */
#configurator-image-block-inner.square-mode {
    min-height: 500px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .custom-predesign-tabs {
        flex-wrap: wrap;
        gap: 10px;
    }

    .custom-tab-item {
        flex: 1;
        min-width: 100px;
        padding: 12px 15px;
    }

    .predesign-image img {
        height: 150px;
    }

    /* Adjust portrait mode for mobile */
    #configurator-image-block-inner.portrait-mode {
        min-height: 400px !important;
    }

    /* Adjust square mode for mobile */
    #configurator-image-block-inner.square-mode {
        min-height: 350px !important;
    }
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .configurator-canvas-sticky {
        position: relative;
        top: auto;
    }

    .configurator-controls-column {
        max-height: none;
        overflow-y: visible;
    }
}

.add-to-cart-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #dee2e6;
    margin-top: 2rem;
}

.add-to-cart-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.product-summary .product-name {
    color: #2c3e50;
    font-weight: 600;
}

.product-summary .base-price {
    font-size: 0.9rem;
}

.product-summary .total-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-summary .price-label {
    font-weight: 600;
    color: #6c757d;
}

.add-to-cart-btn {
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 200px;
    position: relative;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.add-to-cart-btn:disabled {
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.add-to-cart-btn .spinner-border {
    width: 1rem;
    height: 1rem;
}

.validation-errors {
    padding: 0.5rem;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 6px;
    border-left: 3px solid #dc3545;
}

@media (max-width: 768px) {
    .add-to-cart-container {
        margin: 1rem;
    }

    .add-to-cart-btn {
        width: 100%;
        margin-top: 1rem;
    }
}

/* Individual Part Box */
.part-box {
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    margin: 10px !important;
    padding: 15px !important;
    width: 220px !important;
    display: inline-block !important;
    vertical-align: top !important;
    background: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Material Selection Section */
.material-section {
    background: #000 !important;
    color: white !important;
    padding: 10px !important;
    margin-bottom: 15px !important;
    border-radius: 4px !important;
}

.material-dropdown {
    background: transparent !important;
    color: white !important;
    border: none !important;
    width: 100% !important;
    font-size: 14px !important;
}

.material-dropdown option {
    background: #333 !important;
    color: white !important;
}

/* Part Header */
.part-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    transition: background-color 0.2s ease !important;
}

/* Color Selector Wrapper for relative positioning */
.color-selector-wrapper {
    position: relative !important;
}

/* Pattern Toggle Container */
#pattern-toggle-container {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 20px !important;
    width: 100% !important;
}

#pattern-toggle-btn {
    padding: 10px 20px !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
}

/* Color Groups Tabs */
#color-groups-tabs .nav-pills {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 5px !important;
}

#color-groups-tabs .nav-pills .nav-link {
    background: #fff !important;
    border: 2px solid #dee2e6 !important;
    color: #495057 !important;
    margin: 0 !important;
    padding: 10px 8px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    flex: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

#color-groups-tabs .nav-pills .nav-link:hover {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

#color-groups-tabs .nav-pills .nav-link.active {
    background: #af282e !important;
    border-color: #af282e !important;
    color: #fff !important;
    box-shadow: 0 3px 6px rgba(210, 22, 22, 0.3) !important;
}

/* Pattern Palette */
#pattern-palette {
    background: #ffffff !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 20px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#pattern-palette .patterns-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
}

.pattern-btn:hover {
    border-color: #af282e !important;
    transform: scale(1.05) !important;
    box-shadow: 0 3px 6px rgba(210, 22, 22, 0.3) !important;
}

/* Color Group Styling */
.color-group {
    border-bottom: 1px solid #e9ecef !important;
    padding-bottom: 15px !important;
    width: 100% !important;
}

.color-group:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

.color-group-name {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    padding: 8px 15px !important;
    border-radius: 6px !important;
    display: block !important;
    border: 1px solid #dee2e6 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 10px !important;
    text-align: center !important;
    font-weight: bold !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.color-group-colors {
    padding-top: 5px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    width: 100% !important;
}

.part-header:hover {
    background-color: #f0f0f0 !important;
}

/* Selected Color Display */
.selected-color-display {
    width: 25px !important;
    height: 25px !important;
    border: 2px solid #000 !important;
    border-radius: 4px !important;
}

/* Color Palette */
.color-palette {
    background: #f9f9f9 !important;
    padding: 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    margin-top: 10px !important;
    position: absolute !important;
    z-index: 1000 !important;
    min-width: 400px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    left: 0 !important;
    top: 100% !important;
}

/* Colors Grid */
.colors-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
}

/* Color Buttons */
.color-btn {
    width: 35px !important;
    height: 35px !important;
    display: inline-block !important;
    margin: 3px !important;
    cursor: pointer !important;
    border: 2px solid #ccc !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
}

.color-btn:hover {
    border-color: #000 !important;
    transform: scale(1.1) !important;
}

/* Printable Button */
.printable-btn {
    background: #dc3545 !important;
    color: #fff;
    border: none !important;
    border-radius: 3px !important;
    padding: 3px 6px !important;
    font-size: 8px !important;
    cursor: pointer !important;
    margin-right: 5px !important;
    transition: background-color 0.2s ease !important;
    font-weight: bold !important;
}

/* Color Palette Positioning */
.color-palette {
    position: absolute !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    z-index: 1000 !important;
    padding: 10px !important;
    min-width: 320px !important;
    width: 450px !important;
    max-width: 500px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

.color-selector-wrapper {
    position: relative !important;
}

.color-palette.positioned-left {
    right: 0 !important;
    left: auto !important;
}

.color-palette.positioned-right {
    left: 0 !important;
    right: auto !important;
}

.color-palette.custom-positioned {
    left: 0 !important;
    right: auto !important;
    position: absolute !important;
}

/* Pattern Palette Positioning */
#pattern-palette {
    position: relative !important;
    max-width: 90% !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.patterns-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
    padding: 10px !important;
}

/* Mobile specific adjustments */
@media (max-width: 767.98px) {
    .color-palette {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        max-width: none !important;
        width: auto !important;
        z-index: 2000 !important;
        max-height: 60vh !important;
        overflow-y: auto !important;
    }

    .color-palette.positioned-left,
    .color-palette.positioned-right {
        left: 10px !important;
        right: 10px !important;
    }

    #pattern-palette {
        max-width: 95% !important;
        margin: 0 auto !important;
    }

    .patterns-grid {
        gap: 6px !important;
        padding: 8px !important;
    }
}

/* Ensure part boxes don't overflow */
.part-box {
    position: relative !important;
    overflow: visible !important;
}

.printable-btn:hover {
    background: #c82333 !important;
}

/* Selected Info Section */
.selected-info {
    background: #f5f5f5 !important;
    padding: 12px !important;
    font-size: 13px !important;
    border-radius: 4px !important;
    margin-top: 15px !important;
}

.selected-info div {
    margin: 5px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.selected-info i {
    width: 16px !important;
    color: #666 !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .part-box {
        width: calc(50% - 20px) !important;
    }
}

@media (max-width: 768px) {
    .part-box {
        width: calc(100% - 20px) !important;
    }

    #configurator-parts-container {
        padding: 10px !important;
    }

    .color-palette {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-width: auto !important;
        max-width: none !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        padding: 20px !important;
        padding-top: 60px !important;
    }

    .color-palette-close {
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        background: #000 !important;
        color: white !important;
        border: none !important;
        border-radius: 50% !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
        cursor: pointer !important;
        z-index: 10000 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Canvas Modal */
#canvas-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.9) !important;
    z-index: 9999 !important;
    display: none;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

#canvas-modal img,
#canvas-modal canvas {
    max-width: 100% !important;
    max-height: 80% !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    background: white !important;
}

#canvas-modal-close {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: #000 !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 24px !important;
    cursor: pointer !important;
    z-index: 10001 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.2s ease !important;
}

#canvas-modal-close:hover {
    background: #333 !important;
}

/* Mobile specific styles for canvas modal */
@media (max-width: 768px) {
    #canvas-modal {
        padding: 10px !important;
    }

    #canvas-modal img,
    #canvas-modal canvas {
        max-height: 100% !important;
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
    }

    #canvas-modal-close {
        top: 15px !important;
        right: 15px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
    }
}

/* Common color classes */
.color-btn[style*="background-color: #fff"],
.color-btn[style*="background-color: #ffffff"] {
    border-color: #999 !important;
}

.color-btn[style*="background-color: #000"],
.color-btn[style*="background-color: #000000"] {
    border-color: #666 !important;
}

/* original */
.pointer {
    cursor: pointer;
}

.disabled {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.5;
}

.cell {
    cursor: cell;
}

.lightbg {
    background: #dbdbdb;
    color: #000 !important;
}

.darkbg {
    background: #424242;
}

.material-name-text {
    background: #000;
    color: #fff;
    margin-left: 2px;
    height: 20px;
    width: 100%;
    line-height: 18px;
}

.configurator-material-btn {
    width: 15px;
    height: 15px;
    line-height: normal;
}

.configurator-color-btn {
    width: 15px;
    height: 15px;
}

.name-and-btn {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
}

.name-and-btn-2 {
    font-size: 0.7em;
    height: 16px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
}

.d-f-s {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
}

.configurator {
    min-height: 900px;
}

.configurator-image-block {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: flex-start;
    align-items: flex-start;
    min-height: 26vw;
}

.configurator-image-block img {
    position: absolute;
    max-width: 920px;
}

@media (max-width: 575.98px) {
    .configurator-image-block {
        min-height: 58vw;
    }

    .configurator-image-block img {
        max-width: 350px;
    }
}

.configurator h5 {
    border-bottom: 5px solid #c22c33;
    padding-top: 15px;
}

.configurator-customizer-block h5 {
    border-bottom: 0;
}

.configurator h4, .configurator h5, .configurator h6 {
    color: #212528 !important;
}

.designer-type-custom, .designer-type-pre-design {
    cursor: pointer;
    background: #fff;
    color: #000;
}
.designer-type-custom:hover h5, .designer-type-pre-design:hover h5 {
    text-decoration: underline;
}
.designer-type-pre-design h5, .designer-type-custom h5 {
    color: #000;
}
.designer-type-pre-design.active h5, .designer-type-custom.active h5 {
    color: #fff !important;
}
.designer-type-pre-design img, .designer-type-custom img {
    filter: brightness(0);
}
.designer-type-pre-design.active img, .designer-type-custom.active img {
    filter: brightness(1);
}
.designer-type-custom.active, .designer-type-pre-design.active {
    border: 1px solid #000 !important;
    background: #000;
    color: #fff;
}
.designer-type-custom:hover, .designer-type-pre-design:hover {
    border: 1px solid #000 !important;
}


/* settings */
.product-settings {
    padding: 1rem;
}

.setting-item {
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: #ffffff;
    transition: box-shadow 0.2s ease-in-out;
}

.setting-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.setting-item.setting-active {
    border-color: #28a745;
    background-color: #f8fff8;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.setting-image-container {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.setting-image {
    transition: transform 0.3s ease;
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
}

.setting-image-container:hover .setting-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.setting-image-container:hover .image-overlay {
    opacity: 1;
}

.image-overlay i {
    color: white;
    font-size: 1.5rem;
}

.setting-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.setting-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.setting-price {
    background-color: #f8f9fa;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    border-left: 4px solid #28a745;
}

.price-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-right: 0.5rem;
}

.price-value {
    font-weight: 600;
    color: #28a745;
    font-size: 1.1rem;
}

.setting-switch {
    flex-shrink: 0;
}

.setting-toggle {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

.form-check-label {
    margin-left: 0.5rem;
    cursor: pointer;
}

.toggle-text {
    font-weight: 500;
    transition: color 0.2s ease;
}

.setting-toggle:checked + .form-check-label .toggle-text {
    color: #28a745;
}

.setting-description {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.setting-description p {
    line-height: 1.6;
}

.setting-divider {
    margin: 2rem 0;
    border-color: #dee2e6;
}

.no-settings {
    padding: 3rem 1rem;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    margin: 1rem;
}

@media (max-width: 768px) {
    .setting-item {
        padding: 1rem;
    }

    .setting-image-container {
        margin-bottom: 1rem;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .setting-switch {
        margin-top: 1rem;
        align-self: flex-end;
    }
}

/* options */
.product-options {
    padding: 1rem;
}

.option-item {
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: #ffffff;
    transition: box-shadow 0.2s ease-in-out;
}

.option-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.option-item.option-selected {
    border-color: #af282e;
    background-color: #f8f9ff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.option-image-container {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    background-color: #333;
}

.option-image {
    transition: transform 0.3s ease;
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
}

.option-image-container:hover .option-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.option-image-container:hover .image-overlay {
    opacity: 1;
}

.image-overlay i {
    color: white;
    font-size: 1.5rem;
}

.option-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.option-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.option-price {
    background-color: #f8f9fa;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    border-left: 4px solid #af282e;
}

.price-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-right: 0.5rem;
}

.price-value {
    font-weight: 600;
    color: #af282e;
    font-size: 1.1rem;
}

.option-description {
    line-height: 1.5;
    margin-bottom: 0;
}

.option-select-container {
    margin-top: 1rem;
}

.option-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.option-value-item {
    position: relative;
}

.option-value-label {
    width: 100%;
    height: auto;
    min-height: 40px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px solid #dee2e6;
    transition: all 0.2s ease;
    cursor: pointer;
}

.option-value-label:hover {
    border-color: #af282e;
    background-color: #f8f9fa;
}

.option-value-radio:checked + .option-value-label {
    background-color: #af282e;
    border-color: #af282e;
    color: white;
}

.value-image-container {
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 0.25rem;
    margin: 0 auto;
}

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

.value-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.value-name {
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.2;
}

.value-default-badge {
    background-color: #28a745;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

.option-value-radio:checked + .option-value-label .value-default-badge {
    background-color: rgba(255, 255, 255, 0.2);
}

.option-divider {
    margin: 2rem 0;
    border-color: #dee2e6;
}

.no-options {
    padding: 3rem 1rem;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    margin: 1rem;
}

.no-values {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
}

@media (max-width: 768px) {
    .option-item {
        padding: 1rem;
    }

    .option-image-container {
        margin-bottom: 1rem;
    }

    .option-values {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .option-value-label {
        min-height: 70px;
        padding: 0.75rem;
    }

    .value-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .option-values {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== STICKY CANVAS AND FLOATING NAVIGATION ===== */

/* Sticky Canvas Layout */
.configurator-container {
    width: 100%;
    position: relative;
}

/* Desktop Two-Column Layout - Bootstrap Grid */
@media (min-width: 992px) {
    .configurator.d-lg-flex {
        display: flex !important;
        flex-wrap: nowrap;
    }

    .configurator-canvas-column {
        flex: 0 0 42%;
        max-width: 42%;
        padding-right: 20px;
        position: relative;
    }

    /* Sticky wrapper for canvas */
    .configurator-canvas-sticky {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 100px !important;
        z-index: 100 !important;
    }

    /* Make the image block styled */
    .configurator-canvas-column .configurator-image-block {
        background: white;
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        max-height: calc(100vh - 120px);
        overflow: visible;
    }

    .configurator-controls-column {
        flex: 0 0 58%;
        max-width: 58%;
        padding-left: 20px;
        min-height: 100vh;
    }
}

/* Floating Navigation Buttons */
.floating-navigation {
    position: fixed !important;
    top: 50% !important;
    right: 30px !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    z-index: 9999 !important;
    opacity: 1 !important;
    transition: opacity 0.3s ease;
}

.floating-navigation.visible {
    opacity: 1 !important;
}

.floating-navigation.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

.floating-navigation .nav-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    background: rgba(0, 0, 0, 0.85) !important;
    color: white !important;
    border-radius: 50% !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4) !important;
    border: 2px solid transparent !important;
}

.floating-navigation .nav-btn:hover {
    background: #af282e !important;
    color: white !important;
    transform: scale(1.15) !important;
    text-decoration: none !important;
    border-color: rgba(175, 40, 46, 0.4) !important;
}

.floating-navigation .nav-btn.active {
    background: #af282e !important;
    transform: scale(1.1) !important;
    border-color: #af282e !important;
}

.floating-navigation .nav-btn i {
    font-size: 18px !important;
}

/* Mobile - Hide Floating Navigation & Mobile Sticky Setup */
@media (max-width: 991.98px) {
    .floating-navigation {
        display: none !important;
    }

    /* Mobile sticky canvas */
    .configurator-image-block.image-hotspots {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        background: white !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        margin-bottom: 0 !important;
    }

    /* Mobile sticky cart bar - at bottom */
    .mobile-sticky-cart {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 999 !important;
        background: #1a1a1a !important;
        color: white !important;
        padding: 10px 15px !important;
        margin: 0 !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2) !important;
        border-top: 2px solid #af282e !important;
    }

    .mobile-sticky-cart .product-info {
        display: flex !important;
        background-color: #1A1A11 !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        border: none;
    }

    .mobile-sticky-cart .product-name {
        font-size: 14px !important;
        font-weight: 600 !important;
        margin: 0 !important;
        color: white !important;
        flex: 1 !important;
    }

    .mobile-sticky-cart .product-price {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #f8f9fa !important;
        margin: 0 10px 0 0 !important;
    }

    .mobile-sticky-cart .mobile-cart-btn {
        background: #af282e !important;
        border: none !important;
        color: white !important;
        padding: 8px 16px !important;
        border-radius: 5px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        white-space: nowrap !important;
        min-width: 110px !important;
    }

    .mobile-sticky-cart .mobile-cart-btn:hover {
        background: #8b1f24 !important;
    }

    .mobile-sticky-cart .mobile-cart-btn:disabled {
        background: #666 !important;
        opacity: 0.7 !important;
    }

    /* Adjust configurator content spacing */
    .configurator.d-lg-none {
        margin-top: 0 !important;
        padding-bottom: 70px !important; /* Space for mobile sticky cart */
    }
}

/* ===== STICKY BOTTOM CART BAR ===== */

/* Sticky Cart Bar */
.sticky-cart-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #1a1a1a !important;
    color: white !important;
    padding: 15px 0 !important;
    z-index: 9998 !important;
    border-top: 3px solid #af282e !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
}

.sticky-cart-bar .cart-product-info {
    color: white !important;
}

.sticky-cart-bar .product-name {
    font-weight: 600 !important;
    font-size: 16px !important;
    display: block !important;
    margin-bottom: 5px !important;
    color: white !important;
}

.sticky-cart-bar .price-info {
    display: flex !important;
    gap: 15px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.sticky-cart-bar .base-price {
    font-size: 14px !important;
    color: #ccc !important;
}

.sticky-cart-bar .total-price {
    font-weight: 600 !important;
}

.sticky-cart-bar .price-label {
    color: #ccc !important;
}

.sticky-cart-bar .price-value {
    color: #af282e !important;
    font-size: 20px !important;
    font-weight: 700 !important;
}

.sticky-cart-bar .sticky-add-to-cart-btn {
    background: #af282e !important;
    border-color: #af282e !important;
    font-weight: 600 !important;
    padding: 12px 25px !important;
}

.sticky-cart-bar .sticky-add-to-cart-btn:hover {
    background: #8d1f24 !important;
    border-color: #8d1f24 !important;
    transform: translateY(-1px) !important;
}

/* Mobile responsivity for cart bar */
@media (max-width: 767.98px) {
    .sticky-cart-bar {
        padding: 12px 0 !important;
    }

    .sticky-cart-bar .product-name {
        font-size: 14px !important;
    }

    .sticky-cart-bar .price-info {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
    }

    .sticky-cart-bar .price-value {
        font-size: 18px !important;
    }

    .sticky-cart-bar .sticky-add-to-cart-btn {
        width: 100% !important;
        margin-top: 10px !important;
        font-size: 14px !important;
        padding: 10px 20px !important;
    }
}

/* measurements */
.measurements-form {
    padding: 1rem;
}

.setting-group {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

.setting-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-check-input {
    width: 3rem;
    height: 1.5rem;
}

.toggle-text {
    margin-left: 0.5rem;
    font-weight: 500;
}

.measurement-input-group {
    position: relative;
}

.measurement-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #333;
}

.measurement-input {
    border: 2px solid #dee2e6;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.measurement-input:focus,
.measurement-input.active {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: 0;
}

.measurement-input.active {
    background-color: #f8f9ff;
}

.measurement-input.missing {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.measurement-input.missing:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.measurement-label.missing {
    color: #dc3545;
}

/* Settings validation styling */
.setting-dropdown.missing,
select.missing {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.setting-radio-group.missing {
    border: 2px solid #dc3545 !important;
    background-color: #fff5f5 !important;
    border-radius: 4px !important;
    padding: 8px !important;
}

.setting-group.missing {
    border: 2px solid #dc3545 !important;
    background-color: #fff5f5 !important;
}

.measurement-image-container {
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: #fff;
}

.measurement-image {
    max-height: 400px;
    object-fit: contain;
}

.measurement-description {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border-left: 4px solid #007bff;
}

.measurement-name {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.measurement-desc {
    margin-bottom: 0;
    line-height: 1.5;
}

.btn-group .btn {
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.standard-size-info {
    padding: 0.75rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.selected-standard-size {
    font-weight: 600;
    color: #007bff;
}

@media (max-width: 768px) {
    .col-sm-6 {
        margin-bottom: 1rem;
    }

    .measurement-image {
        max-height: 300px;
    }
}
