/* Design tokens */
:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --text: #0f172a; /* slate-900 */
    --text-muted: #475569; /* slate-600 */
    --primary: #3b82f6; /* soft blue */
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --accent: #60a5fa; /* light blue */
    --danger: #ef4444;
    --border: #e2e8f0; /* light border */
    --ring: rgba(37, 99, 235, 0.25);
    --radius: 14px;
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.12);
}

/* General styles */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: 'Alexandria', serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px 12px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Reduce top spacing on mobile */
@media (max-width: 767px) {
    body {
        padding: 10px 8px;
    }
    
    .container.mt-5,
    .container.mt-4 {
        margin-top: 1rem !important;
    }
    
    h1 {
        font-size: 24px;
        margin-top: 8px;
        margin-bottom: 16px;
    }
    
    h2 {
        font-size: 20px;
        margin-top: 16px;
        margin-bottom: 8px;
    }
}

/* Responsive container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

h1, h2 {
    color: var(--text);
    text-align: center;
}

h1 {
    margin-top: 12px;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
}

h2 {
    font-size: 22px;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-muted);
}

/* Image container */
.image-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 16px;
    background-color: var(--surface-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px; /* Adds spacing below the image container */
    overflow-x: auto;
}

.image-container img {
    max-width: 200px;
    height: auto;
    flex: 0 0 auto;
    border-radius: 10px;
}

/* Card/list container */
.list-container,
.card {
    background-color: var(--surface);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin: 20px 0;
    font-size: 16px;
    text-align: left;
    border: 1px solid var(--border);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 767px) {
    .list-container,
    .card {
        padding: 15px;
        margin: 15px 0;
    }
}

ul {
    padding-left: 20px;
    list-style-type: disc;
}

ul ul {
    list-style-type: circle; /* Nested list style */
    padding-left: 20px;
}

li {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.6;
}

/* Table styling */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    box-shadow: var(--shadow-sm);
    border-radius: 10px;
    overflow: hidden;
}

table, th, td {
    border: 1px solid var(--border);
}

th, td {
    padding: 14px 16px;
    text-align: center;
}

thead th {
    background-color: #eff4fb;
    color: #0b1220;
}

tbody td {
    background-color: var(--surface);
}

tr:nth-child(even) td {
    background-color: #f8fafc;
}

tr:hover td {
    background-color: #eef5ff;
}

/* Buttons and links */
a, button, .btn {
    background-color: var(--primary);
    color: #fff;
    padding: 10px 18px;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px 8px 10px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.05s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

a:hover, button:hover, .btn:hover {
    background-color: var(--primary-600);
}

a:active, button:active, .btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background-color: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

.btn-danger {
    background-color: var(--danger);
}

/* Form styling */
form {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    box-sizing: border-box;
    width: 100%;
}

form label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

form input, form textarea, form select {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 16px;
    background-color: #ffffff;
    color: var(--text);
    box-sizing: border-box;
    max-width: 100%;
}

form textarea {
    resize: vertical;
    min-height: 100px;
}

form button[type="submit"] {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

form input:focus, form textarea:focus, form select:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px var(--ring);
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    form {
        padding: 16px;
    }

    form button {
        font-size: 15px;
        padding: 12px;
    }
}

/* Button container */
.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.button-container a {
    text-decoration: none;
}

/* Response message */
#response-message {
    margin-top: 20px;
    font-size: 16px;
    text-align: center;
}

/* No orders message */
#no-orders {
    text-align: center;
    font-size: 16px;
    color: var(--text-muted);
}

/* Tiles (mobile-like menu) */
.tile-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.tile {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--border);
    color: #0b1220;
    padding: 18px 16px;
    text-align: center;
    font-size: 16px;
    border-radius: 18px;
    transition: transform 0.15s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile:hover {
    border-color: #c7dbff;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.tile i {
    font-size: 24px;
}

/* Additional styles for tables */
.table {
    margin-top: 20px;
}

.table td, .table th {
    vertical-align: middle;
}

.btn-custom {
    background-color: var(--primary);
    color: white;
}

.btn-custom:hover {
    background-color: var(--primary-600);
    color: white;
}

/* Force bootstrap button variants to match our palette */
.btn-primary { background-color: var(--primary); border-color: var(--primary-600); }
.btn-primary:hover { background-color: var(--primary-600); border-color: var(--primary-700); }
.btn-success { background-color: var(--accent); border-color: var(--primary-600); color: #0b1220; }
.btn-success:hover { background-color: var(--primary); border-color: var(--primary-700); color: #fff; }
.btn-link { color: var(--primary-700); background: transparent; border: none; box-shadow: none; }
.btn-link:hover { color: var(--primary-600); text-decoration: underline; }

#total-price-container {
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

h1, h2 {
    color: #333;
    text-align: center;
}

h1 {
    margin-top: 20px;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
}

h2 {
    font-size: 22px;
    margin-top: 20px;
    margin-bottom: 10px;
}
/* Keep image container responsive improvements */
.image-container {
    flex-wrap: nowrap; /* Prevent wrapping of images */
    justify-content: space-between; /* Space between images */
}

/* Ensure images fit within container */
.image-container img {
    max-width: 30%; /* Adjust size to fit side by side */
    height: auto; /* Maintain aspect ratio */
    flex: 1; /* Allows images to grow/shrink */
    object-fit: contain; /* Ensure images fit within their container */
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .image-container img { max-width: 35%; }
}
@media (max-width: 992px) {
    .image-container img { max-width: 40%; }
}
@media (max-width: 768px) {
    .image-container img { max-width: 45%; }
}
@media (max-width: 576px) {
    .image-container img { max-width: 50%; }
}

/* Bootstrap form overrides to prevent overflow */
.form-control, .form-select {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

.mb-3, .form-group {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* Ensure Bootstrap cards don't overflow */
.card {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

.card-body {
    box-sizing: border-box !important;
}

/* Mobile specific Bootstrap overrides */
@media (max-width: 767px) {
    .container {
        max-width: 100% !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    .row {
        margin-left: -8px;
        margin-right: -8px;
    }
    
    .col, [class*="col-"] {
        padding-left: 8px;
        padding-right: 8px;
    }
}
