/* General Calculator Box Styling */
#wallpaper-calc-box-square {
    background: #ffffff;
    padding: 0px;
    margin-bottom: 10px;
    border-radius: 0;
    font-family: inherit;
    max-width: 100%;
    box-sizing: border-box;
}
#wallpaper-calc-box-square * {
    box-sizing: border-box;
}

/* Calculator Title */
#wallpaper-calc-box-square .smc-calculator-title {
    margin-top:0;
    font-size: 26px;
    color: #03295d;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #0A2756;
    padding-bottom: 10px;
}

/* Section Titles and Descriptions */
#wallpaper-calc-box-square .smc-calculator-description-section {
    margin: 20px 0;
    margin-top:0;
}
#wallpaper-calc-box-square .smc-section-title {
    font-size: 19px;
    margin-bottom: 5px;
    color: #03295d;
}
#wallpaper-calc-box-square .smc-section-text {
    font-size: 15px;
    color: #666;
    line-height: 1.4;
}

/* Input Fields Container */
#wallpaper-calc-box-square .input-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 800px;
}
#wallpaper-calc-box-square .input-container .input-row {
    flex: 1;
}
#wallpaper-calc-box-square .input-container label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    color: #03295d;
}
#wallpaper-calc-box-square .input-container input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #0A2756;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
}

/* Error Messages */
#wallpaper-calc-box-square .smc-error-message {
    color: #0A2756;
    display: none;
    margin-top: 5px;
    font-size: 13px;
}

/* Buttons */
.smc-button {
    width: 100%;
    max-width: 800px;
    padding: 15px;
    margin: 20px 0;
    background: #03295d;
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.smc-save-pattern-button {
    background: #0A2756;
    font-size: 18px;
}

/* New button for toggling panels */
.smc-toggle-panels-button {
    background: #5a8a1d; /* A different color to distinguish it */
    margin: 10px 0; /* Adjust margin as needed */
    max-width: 800px; /* Match other buttons */
}

.smc-toggle-panels-button:hover {
    background: #7ec23f; /* Lighter hover color */
}

#box-select{display:none !important}
/* Pattern Selector Wrapper */
.smc-pattern-selector-wrapper {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1400px;
    max-height: 90vh;
    margin: 0;
    padding: 30px;
    border: 3px solid #0A2756;
    background: #ffffff;
    box-sizing: border-box;
    z-index: 9999;
    overflow-y: auto;
}
.smc-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #03295d;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
}

/* Konva Container */
.smc-container-wrapper {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1200 / 960; /* Adjust as needed for specific image aspect ratio */
    position: relative;
    margin-bottom: 20px;
}
.smc-konva-container {
    width: 100% !important;
    height: 100% !important;
}
.konvajs-content canvas {
    border: 1px solid rgba(0, 0, 0, 0.3); /* Border for the Konva canvas */
}

/* Pattern Overlay */
.smc-pattern-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9998;
}

/* Coordinates Display */
.smc-coordinates-display {
    display: none;
    width: 100%;
    max-width: 800px;
    margin: 20px 0;
    padding: 15px;
    background: #f0f0f0;
    border-left: 3px solid #03295d;
    box-sizing: border-box;
}

/* Checkbox Section for Trial */
.smc-checkbox-section {
    width: 100%;
    max-width: 800px;
    margin: 20px 0;
    padding: 15px;
    border: 2px dashed #0A2756;
    background: #fffcfc;
}
.smc-checkbox {
    transform: scale(1.5);
    margin-right: 10px;
    vertical-align: middle;
}
.smc-checkbox-label {
    font-size: 18px;
    font-weight: bold;
    color: #03295d;
    vertical-align: middle;
    cursor: pointer;
}

/* Box Select for Trial Size */
.smc-box-select {
    display:none; /* Initially hidden */
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
}
.smc-box-select-label {
    display: block;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #03295d;
}
.smc-select-box {
    width: 100%;
    padding: 12px;
    border: 1px solid #0A2756;
    font-size: 16px;
    outline: none;
    background: white;
    box-sizing: border-box;
}

/* Warning Box */
.smc-warning-box {
    font-size: 14px;
    color: #666;
    margin: 0;
    margin-bottom:5px;
    padding: 12px;
    background: #fffcfc;
    border-left: 3px solid #0A2756;
    box-sizing: border-box;
    width: 100%;
    max-width: 800px;
}

/* Calculation Status */
.smc-calc-status {
    width: 100%;
    max-width: 800px;
    margin-top: 20px;
    padding: 20px;
    border: 2px dashed #0A2756;
    display: none; /* Initially hidden */
    background: #fffcfc;
    box-sizing: border-box;
}
.smc-calc-result {
    font-size: 18px;
    color: #03295d;
    line-height: 1.6;
    margin-bottom: 10px;
}
.smc-total-price {
    font-size: 20px;
    font-weight: bold;
    color: #03295d;
    line-height: 1.4;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    #wallpaper-calc-box-square {
        padding: 15px !important;
        margin-bottom: 20px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-width: 1px !important;
        overflow-x: hidden !important;
    }
    #wallpaper-calc-box-square .smc-calculator-title {
        font-size: 20px !important;
        letter-spacing: 0.5px !important;
        padding-bottom: 8px !important;
    }
    #wallpaper-calc-box-square .smc-section-title {
        font-size: 16px !important;
        margin-top: 10px !important;
    }
    #wallpaper-calc-box-square .smc-section-text {
        font-size: 14px !important;
    }
    
    #wallpaper-calc-box-square .smc-container-wrapper {
        max-width: 100% !important;
    }
    
    #wallpaper-calc-box-square .input-container {
        flex-direction: column !important;
        gap: 15px !important;
        margin-bottom: 15px !important;
        margin-top: 0 !important;
        max-width: 100% !important;
    }
    #wallpaper-calc-box-square .input-container .input-row {
        width: 100% !important;
    }
    #wallpaper-calc-box-square .input-container input[type="number"] {
        padding: 10px !important;
        font-size: 16px !important;
    }
    #wallpaper-calc-box-square .input-container label {
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }
    #wallpaper-calc-box-square .smc-box-select {
        margin-bottom: 15px !important;
        max-width: 100% !important;
    }
    #wallpaper-calc-box-square .smc-box-select-label {
        font-size: 14px !important;
    }
    #wallpaper-calc-box-square .smc-select-box {
        padding: 10px !important;
        font-size: 15px !important;
    }
    #wallpaper-calc-box-square .smc-calc-status {
        padding: 15px !important;
        max-width: 100% !important;
    }
    #wallpaper-calc-box-square .smc-calc-result {
        font-size: 16px !important;
    }
    #wallpaper-calc-box-square .smc-total-price {
        font-size: 18px !important;
    }
    #wallpaper-calc-box-square .smc-warning-box,
    #wallpaper-calc-box-square .smc-coordinates-display {
        font-size: 13px !important;
        padding: 10px !important;
        margin: 15px 0 !important;
        max-width: 100% !important;
    }
    .smc-checkbox-section {
        margin: 15px 0 !important;
        padding: 12px !important;
        max-width: 100% !important;
    }
    .smc-checkbox-label {
        font-size: 16px !important;
    }
}

/* WooCommerce Cart Table Adjustments */
.woocommerce-cart-form__cart-item .product-quantity {
    display: none;
}
.woocommerce-cart-form__cart-item .product-name {
    width: 50%;
}
.woocommerce-cart-form__cart-item .product-price,
.woocommerce-cart-form__cart-item .product-subtotal {
    width: 25%;
}
.woocommerce-cart .product-quantity {
    /* Ensures the quantity column itself is hidden for the original quantity input */
    display: none;
}
/* Style for custom quantity display in cart */
.woocommerce-cart .product-name .quantity {
    display: block;
    font-size: 0.9em;
    color: #777;
    margin-top: 5px;
}

/* Ensure the custom quantity display is not hidden by other rules */
.woocommerce-cart-form__cart-item .product-name > .quantity {
    display: block !important;
}



/* Pattern Selector Wrapper */
.smc-pattern-selector-wrapper {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1200px; /* Zmniejszono z 1400, aby lepiej pasowało do proporcji Konva */
    max-height: 95vh;
    margin: 0;
    padding: 40px; /* Większy padding dla oddechu */
    border: 3px solid #0A2756;
    background: #ffffff;
    box-sizing: border-box;
    z-index: 9999;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Kontener na płótno Konva */
.smc-container-wrapper {
    width: 100%;
    max-width: 1000px; /* Ograniczenie szerokości na PC */
    margin: 0 auto 20px auto; /* Centrowanie i margines pod spodem */
    height: auto;
    aspect-ratio: 1200 / 960; 
    position: relative;
    background: #f9f9f9;
}

/* Przycisk Zapisz pod płótnem */
.smc-save-pattern-button {
    display: block;
    width: 100%;
    max-width: 400px; /* Przycisk nie musi być na całą szerokość ekranu PC */
    margin: 20px auto 0 auto; /* Wycentrowanie przycisku */
    background: #0A2756;
    font-size: 18px;

}

.smc-save-pattern-button:hover {
    background: #b88489;
}

@media (max-width: 767px) {
    .smc-pattern-selector-wrapper {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        padding: 20px;
    }
    
    .smc-save-pattern-button {
        max-width: 100% !important;
    }
}