html {
    font-size: 16px;
    color: #3e3e3e;
    line-height: 1.44;
}

body {
    font-family: 'Helvetica Neue', '微軟正黑體', 'Microsoft JhengHei', Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: auto;
    background: #fff;
    padding: min(5%, 20px) min(4%, 30px);
    border: 1px solid #ddd;
    border-radius: 5px;
}

.page_title {
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.page_title span {
    font-weight: 500;
}

/* Product Section Styles */
.product-section {
    border-bottom: 1px solid #eee;
    padding-top: 5px;
    padding-bottom: 28px;
    margin-bottom: 20px;
}

.product-section .new-text {
    font-size: 1.125rem;
    margin-left: 6px;
}

.section-title {
    margin: 0 0 4px 0;
}

.product-title {
    margin-bottom: 20px;
}

.product-name {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    padding: 4px 10px;
    border-radius: 7px;
    background-image: linear-gradient(181deg, #1ec468 3%, #1a9f55 88%);
}

.unit-label {
    font-size: 1.0625rem;
}

.product-item {
    display: flex;
    align-items: flex-start;
}

.product-item img {
    width: 90px;
    height: auto;
    margin-top: 6px;
    margin-right: 4%;
}

.product-details{
    font-size: 1.125rem;
}

.product-details p.subtitle {
    margin: 0 0 4px 0;
    font-weight: bold;
}

.product-details p {
    margin: 0;
}

.product-details ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

/* Form Section Styles */
.selection-section {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
}

.form-label-bold {
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.radio-group {
    margin-bottom: 15px;
}

.radio-category {
    font-size: 1.125rem;
    font-weight: bold;
    margin: 0 0 5px 0;
    display: inline-block;
    padding-left: 6px;
}

.radio-item {
    margin-bottom: 2px;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
    vertical-align: middle;
}

.radio-group label {
    vertical-align: middle;
}

.new-text {
    color: #ff0000;
    font-weight: bold;
}

.sold-out {
    color: #999;
    font-style: italic;
}

.tips-text {
    color: #ff4500;
    font-weight: bold;
    margin-top: 24px;
    margin-bottom: 4px;
}

.disclaimer {
    font-size: 0.95rem;
    color: #777;
    margin-top: 0;
    margin-bottom: 0;
}

/* Form Fields */
.form-fields label {
    margin-bottom: 5px;
    font-weight: bold;
}

.form-fields input,
.form-fields select {
    font-size: 1rem;
}

label.required::after {
    content: " *";
    color: red;
}

.form-row {
    margin-bottom: 15px;
}

input[type="text"],
input[type="tel"],
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

input::placeholder {
    color: #bbb;
}

.radio-inline {
    display: block;
    margin-top: 5px;
}

.radio-inline input[type="radio"] {
    margin-right: 8px;
}

.final-check {
    font-weight: bold;
    color: #d9534f;
    margin-top: 20px;
}

button[type="submit"] {
    background-color: #5cb85c;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 10px;
}

button[type="submit"]:hover {
    background-color: #4cae4c;
}

/* Address row grid layout */
.address-row {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.col-6 {
    flex: 0 0 calc(50% - 5px);
}

.col-12 {
    flex: 0 0 100%;
}

/* Product checkbox section */
.product-checkbox-section {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.product-selection-title {
    font-weight: bold;
    margin: 0 0 15px 0;
    color: #333;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.checkbox-item label {
    font-weight: normal;
    cursor: pointer;
    margin: 0;
}

/* Field validation styles */
input.error,
select.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.field-error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

input:focus:not(.error),
select:focus:not(.error) {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Valid input styles - only when not in error state */
input:valid:not(:placeholder-shown):not(.error) {
    border-color: #28a745;
}

/* Remove automatic valid styling for selects - will be handled by JS validation */
select:valid:not(.error) {
    border-color: #ccc;
}

/* Valid select style when manually validated and not in error state */
select.valid:not(.error) {
    border-color: #28a745;
}

/* 12px */
.fs_n3 {
    font-size: 0.75rem !important;
}

/* 13px */
.fs_n3 {
    font-size: 0.8125rem !important;
}

/* 14px */
.fs_n2 {
    font-size: 0.875rem !important;
}

/* 15px */
.fs_n1 {
    font-size: 0.9375rem !important;
}

/* 16px */
.fs_1 {
    font-size: 1rem !important;
}

/* 17px */
.fs_2 {
    font-size: 1.0625rem !important;
}

/* 18px */
.fs_3 {
    font-size: 1.125rem !important;
}

/* 19px */
.fs_4 {
    font-size: 1.1875rem !important;
}

/* 20px */
.fs_5 {
    font-size: 1.25rem !important;
}

/* Mobile responsive styles */
@media (max-width: 767px) {
    body {
        padding: 0;
    }
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #008080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #008080;
    font-size: 1.125rem !important;
    font-weight: 500;
    margin: 0;
}