* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

.quantity-select.invalid {
    border: 2px solid red;
    background-color: #fff5f5;
}

#replace-section button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#estimated-refunded {
    font-weight: bold;
}

.container {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
    transition: box-shadow 0.3s ease;
}

.container:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.banner {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: cover;
    display: block;
    margin-bottom: 1.5rem;
    border-radius: 8px 8px 0 0;
}

h1 {
    color: #000000;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.3rem;
    font-weight: 500;
    margin: 1.25rem 0;
}

.form-group {
    margin-bottom: 1.75rem;
    text-align: left;
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 1rem;
    margin-top: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #f8f9fa;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #000000;
    box-shadow: 0 0 0 0.25rem rgba(0, 0, 0, 0.1);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 140px;
}

button, .button {
    background-color: #000000;
    color: #ffffff;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0.75rem 0;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: inline-block;
    width: 100%;
}

button:hover, .button:hover {
    background-color: #212529;
    transform: translateY(-3px);
}

.back-button, .cancel-button {
    background: none;
    color: #000000;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    transition: color 0.3s ease, border-color 0.3s ease;
    width: auto; /* Override width: 100% to fit content */
    display: inline-block; /* Ensure proper inline behavior */
}
@media (max-width: 768px) {
    .back-button, .cancel-button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        width: auto; /* Maintain auto width on mobile */
    }
}
.back-button:hover, .cancel-button:hover {
    color: #555555;
    border-color: #000000;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.flex-col {
    flex-direction: column;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

.loading {
    margin: 1.5rem auto;
    width: 48px;
    height: 48px;
    border: 5px solid #dee2e6;
    border-top: 5px solid #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    color: #dc3545;
    font-size: 0.95rem;
    margin-top: 1rem;
    text-align: center;
}

.language-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.language-switch select {
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.language-switch select:hover {
    border-color: #000000;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    overflow-x: auto;
    display: table;
}

.items-table th,
.items-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
}

.items-table th {
    background-color: #f1f3f5;
    font-weight: 600;
}

.item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin-right: 1rem;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

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

.item, .replace-item {
    margin: 1.25rem 0;
    padding: 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: box-shadow 0.3s ease;
    position: relative;
}

.item:hover, .replace-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.replace-item p {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

pre {
    text-align: left;
    background-color: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    white-space: pre-wrap;
    overflow-x: auto;
    border: 1px solid #dee2e6;
}

footer {
    padding: 1.5rem 1rem;
    background-color: #ffffff;
    color: #000000;
    text-align: center;
}

.footer-links,
.footer-socials {
    color: #000000;
    margin-bottom: 1rem;
}

.footer-links a,
.footer-socials a {
    color: #000000;
    text-decoration: none;
    margin: 0 0.75rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: inline-block;
}

.footer-links a:hover,
.footer-socials a:hover {
    color: #000000;
}

.toggle-switch {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem; /* Changed from right: 1.25rem; to place at beginning */
    right: auto;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ced4da;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #000000;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.items-counter {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    text-align: left;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.toastify {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    color: #000000;
    transition: all 0.3s ease;
    max-width: 320px;
}

.toastify.error {
    background-color: #fff5f5;
    border: 1px solid #dc3545;
    color: #dc3545;
}

.toastify.success {
    background-color: #e6ffed;
    border: 1px solid #28a745;
    color: #28a745;
}

#success-section {
    text-align: left;
}

#success-section pre {
    background-color: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    white-space: pre-wrap;
    border: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
        max-width: 95%;
    }

    .banner {
        max-height: 80px;
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    button, .button {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
    }

    .back-button, .cancel-button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .language-switch {
        top: 0.5rem;
        right: 0.5rem;
    }

    .language-switch select {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .items-table {
        font-size: 0.9rem;
        display: table;
        overflow-x: auto;
    }

    .items-table th, .items-table td {
        padding: 0.75rem;
    }

    .item-image {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }

    input[type="text"]#order_number {
        width: 100%;
        font-size: 1rem;
        letter-spacing: normal; /* Adjusted for mobile readability */
    }

    .form-group:has(#order_number)::before {
        display: none; /* Simplify for mobile */
    }

    .toggle-switch {
        width: 50px;
        height: 28px;
    }

    .slider:before {
        height: 20px;
        width: 20px;
        left: 4px;
        bottom: 4px;
    }

    input:checked + .slider:before {
        transform: translateX(22px);
    }

    .toastify {
        font-size: 0.85rem;
        padding: 0.75rem;
        max-width: 90%;
    }

    footer {
        padding: 1rem 0.75rem;
    }

    .footer-links a,
    .footer-socials a {
        margin: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }
}
.item h3, .replace-item h3, .item p, .replace-item p, .item, .replace-item {
    padding-left: 50px; /* Space for left toggle; adjust for refund/replace sections */
    word-break: break-word; /* Wrap long item names to second line */
}

.replace-item p {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    word-break: break-word; /* Ensure wrap */
}

.item:hover, .replace-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* For items-table if toggles are there (assuming similar structure), add if needed */
.items-table td:first-child {
    position: relative;
    padding-left: 80px; /* If toggle in table cell */
}

@media (max-width: 768px) {
    .toggle-switch {
        top: 0.75rem;
        left: 0.75rem;
        width: 50px;
        height: 28px;
    }

    .item h3, .replace-item h3, .item p, .replace-item p, .item, .replace-item {
        padding-left: 60px; /* Adjust for mobile */
    }

    .slider:before {
        height: 20px;
        width: 20px;
        left: 4px;
        bottom: 4px;
    }

    input:checked + .slider:before {
        transform: translateX(22px);
    }
}

.footer-legal { margin-top: 6px; font-size: 12px; opacity: 0.75; }
.footer-legal a { color: inherit; text-decoration: underline; }
