/* For Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* For Firefox and Future Browsers */
.field input[type=number],
.field-amount input[type=number],
.field-selector-amount input[type=number],
.labourfield input[type=number] {
    -moz-appearance: textfield !important;/* Force override for Firefox */
}

/* GLOBAL RESETS & BASE */
body {
    background-color: #fff9ed;
    font-family: Helvetica;
}
* {
    box-sizing: border-box;
}

/* CONTAINER STYLES */
.general-container {
    background-color: #fff9ed;
    display: flex;
    justify-content: flex-start;
    padding: 10px; /* <--- NOTE: This padding will now be INCLUDED in the size due to box-sizing: border-box */
    
    /* CRITICAL FIXES */
    height: 98vh;
    width: 100%;       /* Ensure it fills the full width */
    
    /* Best Practice: Use border-box to contain padding within the 100% width/height */
    box-sizing: border-box; 
}

.specs-bg, .illustration-bg, .breakdown-bg {
    filter: 
    drop-shadow(3px 1px 4px #96968e) 
    drop-shadow(-3px 1px 4px #96968e);
}

.illustration, .specs-group {
    filter: 
    drop-shadow(3px 1px 4px #96968e48) 
    drop-shadow(-3px 1px 4px #96968e48);
}

.specs-bg, .illustration-bg {
    margin-right: 15px;
    border-radius: 30px;
}

.specs-bg, .illustration-bg, .breakdown-bg {
    min-height: 850px;
}

.breakdown-bg {
    border-radius: 30px;
}

.specs-bg, .breakdown-bg, .illustration {
    background-color: #ffffff;
    border-radius: 30px;
}
.specs-bg {
    max-width: 420px;
    min-width: 400px;
}
.illustration-bg {
    background-color: #ffffff;
    max-width: 850px;
    width: 90%;
}

.breakdown-bg, .breakdown-header, .breakdown-body, .specs-group {
    padding: 5px 7px 5px;
    border-radius: 30px;
}

.breakdown-header, .breakdown-body {
    width: 100%;
    margin-right: 2px;
}

.breakdown-bg {
    width: 30%;
    flex-shrink: 0;
}

/* FLEX & LAYOUT STYLES */
.specs-fields {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    padding: 10px 3%;
}

.specs-group {
    background-color: #ffffff;
    padding-top: 10px;
    margin-top: 15px;
    max-height: 100%;
}

.illustration, .illustration-header, .toggles, .measurement-group, .labour-group, .illustration-selector, .comment-container {
    display: flex;
    flex-direction: column;
}
.illustration-header {
    width: 100%;
    max-width: 700px;
    padding-top: 0px;
    padding-left: 15px;
    padding-top: 10px;
}
.illustration-selector, .comment-container {
    flex-shrink: 0;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 15px;
}

.selector-row, .toggle-row {
    display: flex;
    align-items: center; 
}
.selector-row {
    gap: 5px; 
    margin-bottom: 5px;
}

.selector-row select {
    font-size: 12px;
}

.illustration {
    margin: 10px;
    max-height: 450px;
}
.illustration svg {
    transform: scale(0.9);
    /*transform-origin: top left;*/
    height: 100%;
    width: 100%;
}
.measurements, .labourvalues {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    height: auto;
    min-height: 70px;
    max-height: 150px;
    max-width: 350px;
    margin-bottom: 20px;
}
.toggles {
    flex: 1;
    margin-right: 10px;
    min-width: 90px;
    gap: 8px;
}

.toggle-row {
    justify-content: space-between;
    max-width: 230px;
}

/* 3. Optional: Style the checkbox input specifically */
.toggle-row input[type="checkbox"] {
    /* Optional: Ensure the checkbox is compact */
    margin-left: 0px;
}
.download-button {
    margin-bottom: 10px;
}
.measurement-group, .labour-group, .customer-group {
    flex: 1;
    margin-right: 10px;
    min-width: 90px;
}
.customer-group {
    margin-top: 15px;
}
.selector-group {
    display: flex;
    flex-direction: row;
    flex: 1;
    gap: 5px;
    min-width: 350px;
    margin-bottom: 5px;
    align-items: center;
}

/* TEXT STYLES */
.main-heading, .subheading, .subheading1, .subheading2 {
    color: #102A43;
}
.main-heading {
    font-size: 20px;
    font-weight: bolder;
    min-width: 280px;
    margin-bottom: 5px;
    margin-top: 0px;
}
.subheading1, .subheading2, .breakdown-subheading {
    margin-bottom: 5px;
}
.subheading1, .subheading2, .breakdown-total, .side-label, .breakdown-subheading {
    font-weight: bold;
}
.subheading1, .explaination, .explaination-foam {
    font-size: 12px;
}
.subheading2 {
    font-size: 18px;
    margin-bottom: 2px;
}
.breakdown-subheading {
    font-size: 16px;
    margin-bottom: 3px;
}
.explaination, .explaination-foam {
    color: #102a43;
    margin-top: 3px;
    margin-bottom: 0px;
    min-width: 280px;
}
.explaination-foam {
    padding-bottom: 3px;
}

.side-label {
    width: 48px; 
    text-align: left; 
    font-size: 12px;
    color: #102A43; /* Match your main text color */
}

/* INPUT CONTAINER STYLES (Field, Field-Amount, Total-Field) */
.field, .labourfield, .field-amount, .total-field, .field-selector-amount {
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    margin-bottom: 5px;
    max-width: 300px;
}
.field, .field-amount, .labourfield {
    height: 25px;
}
.field {
    width: 80px;
}
.labourfield {
    width: 55px;
}
.field-amount {
    width: 40px;
}
.field-selector-amount {
    height: 21px;
    width: 35px;
    margin-top: 4px;
}
.field-selector-amount input {
    font-size: 12px;
}
.total-field {
    width: 100%;
    height: 30px;
}

.customer-container {
    width: 350px;
    height: 30px;
}

.solid1 {
    max-width: 430px;
    margin-top: 15px;
}
.field input, .labourfield input,
#height, #width, #length, #amount, #zipper, #velcrohook, #velcroloop, #handle, #strap, #logo, #zipperlock, #cutting, #sewing, #machining, #otherwork, #customer {
    width: 100%;
    height: 100%;
    border: 1px solid #6e6e6e;
    outline: none;
    background: white;
    padding: 0 5px;
    font-size: 15px;
    /* Common input styles */
}

/* ID OVERRIDES: Apply border and specific text alignment only to these elements */
#height, #width, #length, #amount, #zipper, #velcrohook, #velcroloop, #handle, #strap, #logo, #zipperlock, #cutting, #sewing, #machining, #otherwork, #customer {
    text-align: left;
    border-radius: 5px;
    margin-top: -5px;
    margin-bottom: -5px;
}


/* SELECT DROPDOWN STYLES */
.canvas-select, .foam-select, .zipper-select, .zipperLock-select, .velcroHook-select, .velcroLoop-select, .handle-select, .strap-select, .thread-select {
    max-width: 400px;
}

#comment {
    resize: vertical; /* Allows user to drag to change height (optional, but good) */
    text-align: left; /* Ensures text aligns left (not justified) */
    vertical-align: top; /* Ensures content starts at the top (Good practice for textareas) */
    background: white;
    width: 100%;
    min-height: 80px; /* New: Use min-height directly on the textarea for size control */
    border: 1px solid #6e6e6e;
    border-radius: 5px;
    box-sizing: border-box;
    outline: none;
    padding: 5px;
    font-size: 15px;
    margin: 0;
}

.comment-container {
    height: auto;
    padding-bottom: 15px;
}

/* Style for the container that holds the cost breakdown lines */
.unitCostBreakdownContainer, .labourCostBreakdownContainer, .totalCostBreakdownContainer {
    /* Optional: Set a max width or padding to match your design */
    padding: 8px 0;
}

/* Style for each individual line item */

.breakdown-line, .breakdown-sub-total, .breakdown-total {
    display: flex;
    justify-content: space-between;
}

/* Group shared separator/margin for totals */
.breakdown-sub-total, .breakdown-total {
    margin-top: 8px;
    padding-top: 4px;
    font-size: 15px;
    border-top: 1px solid #ddd;
}

.breakdown-total {
    font-weight: bold;/* Unique style for final total */
}
.breakdown-line {
    display: flex;
    justify-content: space-between;/* Pushes label to the left, cost to the right */
    margin-bottom: 4px;
}
/* Style for the item label (e.g., "Canvas Material") */
.breakdown-label {
    font-style: italic;
    color: #555;
    font-size: 14px;
}
.breakdown-label-number {
    font-size: 15px;
}


/* --- Mobile/Tablet Styles: Stack containers vertically --- */

@media screen and (max-width: 768px) {
    /* Step 1: Change the main container to stack its children */
    .general-container {
        flex-direction: column;
        height: auto; /* Allow the container to grow to fit all stacked content */
        min-height: 100vh; /* Ensure full initial visibility */
    }

    /* Step 2: Ensure the stacked children now fill the available width (100%) */
    .specs-bg, .illustration-bg, .breakdown-bg {
        width: 100% !important; 
        max-width: 100% !important;
        
        /* FIX MARGINS: Remove inherited desktop margin-right */
        margin-right: auto !important;
        margin-left: auto !important; /* Center the block */

        /* Vertical space */
        margin-bottom: 20px; 
    }
}