/**
 * Aim's Order Form Styles
 * Matching your existing site design (beige/green theme)
 */

:root {
    --primary-color: #5c6f4e;
    --primary-dark: #2c3e1f;
    --primary-light: #7a9b6a;
    --secondary-bg: #f5f1e8;
    --text-color: #333;
    --text-secondary: #555;
    --text-muted: #666;
    --text-light: #888;
    --bg-white: #fff;
    --bg-card: #fff;
    --bg-gray: #f9f9f9;
    --border-color: #e0d5c7;
    --border-light: #ddd;
    --shadow-sm: rgba(0,0,0,0.08);
    --shadow-md: rgba(92, 111, 78, 0.15);
    --shadow-lg: rgba(92, 111, 78, 0.2);
    --error-color: #c33;
    --error-bg: #fee;
    --error-border: #c33;
    --success-bg: #e8f5e9;
    --success-border: #4caf50;
    --success-text: #2e7d32;
    --warning-bg: #fff3cd;
    --warning-border: #ffc107;
}

body.dark-mode {
    --primary-color: #7a9b6a;
    --primary-dark: #5c6f4e;
    --primary-light: #9cbd8a;
    --secondary-bg: #2d2d2d;
    --text-color: #e5e5e5;
    --text-secondary: #c5c5c5;
    --text-muted: #a5a5a5;
    --text-light: #888;
    --bg-white: #1a1a1a;
    --bg-card: #242424;
    --bg-gray: #2a2a2a;
    --border-color: #3d3d3d;
    --border-light: #3d3d3d;
    --shadow-sm: rgba(0,0,0,0.3);
    --shadow-md: rgba(0,0,0,0.4);
    --shadow-lg: rgba(0,0,0,0.5);
    --error-color: #ff6b6b;
    --error-bg: #3d2020;
    --error-border: #ff6b6b;
    --success-bg: #1d3d1d;
    --success-border: #66bb6a;
    --success-text: #81c784;
    --warning-bg: #3d3520;
    --warning-border: #ffd54f;
}

.aims-order-form-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    width: 100%;
    overflow-x: hidden;
}

/* Header */
.aims-order-header {
    text-align: center;
    margin-bottom: 40px;
}

.aims-order-header h2 {
    font-size: 2em;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.aims-order-header p {
    color: var(--text-muted);
    font-size: 1.1em;
}

/* Loading State */
.aims-loading {
    text-align: center;
    padding: 60px 20px;
}

.aims-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--secondary-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Error State */
.aims-error {
    background: var(--error-bg);
    border: 2px solid var(--error-border);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.aims-error-message {
    color: var(--error-color);
    font-weight: 600;
}

/* Table Navigation */
.aims-table-nav {
    margin-bottom: 30px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-sm);
}

.aims-table-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 100%;
}

.aims-table-nav-btn {
    background: var(--secondary-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.aims-table-nav-btn:hover {
    background: var(--bg-gray);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.aims-table-nav-btn.active {
    background: var(--primary-color);
    color: var(--bg-white);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.aims-table-nav-btn.no-products {
    opacity: 0.6;
    border-style: dashed;
}

.aims-table-nav-btn.no-products:not(.active) {
    color: var(--text-light);
    border-color: var(--text-light);
}

/* Deprecated Filters (keeping for backward compatibility) */
.aims-filters {
    display: none;
}

.aims-filter-btn {
    display: none;
}

/* Products Grid */
.aims-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    max-width: 100%;
    width: 100%;
}

/* Table Group (for "Alles" view) */
.aims-table-group {
    grid-column: 1 / -1;
    display: contents;
}

.aims-table-header {
    grid-column: 1 / -1;
    font-size: 1.6em;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 30px 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
}

.aims-table-header:first-child {
    margin-top: 0;
}

/* Product Group */
.aims-product-group {
    grid-column: 1 / -1;
    display: contents;
}

.aims-group-header {
    grid-column: 1 / -1;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 10px 0;
}

.aims-group-products {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    max-width: 100%;
    width: 100%;
}
.aims-product-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.aims-product-card:hover {
    box-shadow: 0 4px 12px var(--shadow-md);
    transform: translateY(-2px);
}

.aims-product-card.hidden {
    display: none;
}

.aims-product-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    gap: 10px;
    max-width: 100%;
}

.aims-product-name {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    user-select: none;
}

.aims-product-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
    padding: 8px;
    background: var(--bg-gray);
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    transition: all 0.3s ease;
}

.aims-product-price {
    font-size: 1.1em;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
}

.aims-product-category {
    font-size: 0.85em;
    color: var(--text-light);
    margin-top: 5px;
}

.aims-product-weight {
    font-size: 0.9em;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 5px;
}

.aims-product-quantity {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aims-product-quantity label {
    font-weight: 500;
    color: var(--text-secondary);
}

.aims-quantity-input {
    width: 100px;
    padding: 8px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1em;
    background: var(--bg-white);
    color: var(--text-color);
}

.aims-quantity-unit {
    color: var(--text-light);
    font-size: 0.9em;
}

.aims-quantity-controls {
    display: flex;
    gap: 5px;
}

.aims-qty-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--primary-color);
    background: var(--bg-card);
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.2s ease;
}

.aims-qty-btn:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

.aims-product-subtotal {
    margin-top: 10px;
    text-align: right;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-color);
}

/* Product Actions Container */
.aims-product-actions {
    margin-top: 15px;
    display: flex;
    gap: 8px;
}

/* Single Add to Cart Button */
.aims-add-to-cart-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-sm);
}

.aims-add-to-cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-md);
}

.aims-add-to-cart-btn:active {
    transform: translateY(0);
}

/* Ready state: quantity entered but not added yet */
.aims-add-to-cart-btn.ready {
    background: #4caf50;
}

.aims-add-to-cart-btn.ready:hover {
    background: #45a049;
}

/* Added state: product successfully added to cart */
.aims-add-to-cart-btn.added {
    background: #4caf50;
}

.aims-add-to-cart-btn.added:hover {
    background: #45a049;
}

/* Modified state: quantity changed after adding */
.aims-add-to-cart-btn.modified {
    background: #ff9800;
}

.aims-add-to-cart-btn.modified:hover {
    background: #f57c00;
}

/* Modify Button (Grey) */
.aims-modify-btn {
    flex: 0 0 auto;
    min-width: 110px;
    padding: 12px 16px;
    background: var(--bg-gray);
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.aims-modify-btn:hover {
    background: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 6px var(--shadow-sm);
}

/* Modified state for Modify Button (Orange) */
.aims-modify-btn.modified {
    background: #ff9800;
    color: white;
    border-color: #ff9800;
}

.aims-modify-btn.modified:hover {
    background: #f57c00;
    border-color: #f57c00;
}

/* Add Again Button (Green) */
.aims-add-again-btn {
    flex: 1 1 auto;
    padding: 12px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-sm);
}

.aims-add-again-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-md);
}

.aims-add-again-btn:active {
    transform: translateY(0);
}

.aims-add-again-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Full width variant for per stk products */
.aims-add-again-btn.full-width {
    flex: 1 1 100%;
}

/* Shopping Cart */
.aims-cart {
    background: var(--secondary-bg);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
}

.aims-cart h3 {
    color: var(--primary-dark);
    margin-top: 0;
    margin-bottom: 20px;
}

.aims-cart-items {
    margin-bottom: 20px;
}

.aims-cart-group {
    margin-bottom: 30px;
}

.aims-cart-group-header {
    font-size: 1.3em;
    color: var(--primary-dark);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.aims-cart-item {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aims-cart-item-info {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.aims-cart-item-name {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.aims-cart-item-quantity {
    font-size: 0.9em;
    color: var(--text-muted);
}

.aims-cart-item-edit-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.aims-cart-quantity-input {
    width: 80px;
    padding: 6px 8px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.95em;
    background: var(--bg-white);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.aims-cart-quantity-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.aims-cart-quantity-unit {
    color: var(--text-light);
    font-size: 0.85em;
    font-weight: 500;
}

.aims-cart-unit-price {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-left: 4px;
}

.aims-cart-confirm-btn {
    background: #4caf50;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0 4px;
}

.aims-cart-confirm-btn:hover {
    background: #45a049;
    transform: scale(1.1);
}

.aims-cart-confirm-btn:active {
    transform: scale(0.95);
}

.aims-cart-item-price {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1em;
}

.aims-cart-item-remove {
    background: var(--error-color);
    color: var(--bg-white);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 15px;
    font-size: 1.2em;
    transition: all 0.2s ease;
}

.aims-cart-item-remove:hover {
    background: #a22;
}

.aims-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3em;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 10px;
}

.aims-price-disclaimer {
    font-size: 0.9em;
    color: var(--text-muted);
    margin: 10px 0;
    padding: 10px;
    background: var(--warning-bg);
    border-left: 4px solid var(--warning-border);
    border-radius: 4px;
}

.aims-cart-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.aims-cart-actions a,
.aims-cart-actions button {
    flex: 1;
    min-width: 150px;
}

/* Form */
.aims-form {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.aims-form-row {
    margin-bottom: 20px;
}

.aims-form-row label {
    display: block;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.required {
    color: var(--error-color);
}

.aims-form-row input[type="text"],
.aims-form-row input[type="email"],
.aims-form-row input[type="tel"],
.aims-form-row input[type="date"],
.aims-form-row textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: var(--bg-white);
    color: var(--text-color);
}

.aims-form-row input:focus,
.aims-form-row textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.aims-date-info {
    margin-top: 8px;
    padding: 10px;
    background: var(--success-bg);
    border-left: 4px solid var(--success-border);
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--success-text);
    display: none;
}

.aims-date-info.show {
    display: block;
}

.aims-date-info.error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-color);
}

/* Buttons */
.aims-btn-primary,
.aims-btn-secondary {
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

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

.aims-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.aims-btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.aims-btn-secondary {
    background: var(--bg-card);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.aims-btn-secondary:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

.aims-form-actions {
    margin-top: 30px;
    text-align: center;
}

/* Success Message */
.aims-success {
    text-align: center;
    padding: 60px 20px;
    background: var(--secondary-bg);
    border-radius: 12px;
}

.aims-success-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.aims-success h3 {
    color: var(--primary-dark);
    font-size: 2em;
    margin-bottom: 20px;
}

.aims-success p {
    font-size: 1.1em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.aims-success strong {
    color: var(--primary-color);
}

#aims-new-order {
    margin-top: 30px;
}

/* Empty Cart Message */
.aims-cart-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

/* No Products Message */
.aims-no-products {
    text-align: center;
    padding: 60px 20px;
    background: var(--secondary-bg);
    border-radius: 12px;
    color: var(--text-muted);
}

.aims-no-products p {
    margin: 10px 0;
    font-size: 1.1em;
}

.aims-no-products p:first-child {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.2em;
}

/* Radio Group for Time Slots */
.aims-radio-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.aims-radio-option {
    flex: 1;
    min-width: 150px;
}

.aims-radio-option input[type="radio"] {
    display: none;
}

.aims-radio-option label {
    display: block;
    background: var(--secondary-bg);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--primary-color);
}

.aims-radio-option input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: var(--bg-white);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.aims-radio-option label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.aims-radio-option input[type="radio"]:disabled + label {
    background: var(--bg-gray);
    border-color: var(--text-light);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.aims-radio-option input[type="radio"]:disabled + label:hover {
    transform: none;
    box-shadow: none;
}

/* Sticky Cart Icon */
.aims-floating-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 999;
    text-decoration: none;
}

.aims-floating-cart:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow-lg);
    text-decoration: none;
}

.aims-floating-cart.hidden {
    display: none;
}

.aims-cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error-color);
    color: var(--bg-white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Back to Top Button */
.aims-back-to-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--secondary-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-lg);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 998;
}

.aims-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.aims-back-to-top:hover {
    background: var(--primary-color);
    color: var(--bg-white);
    transform: translateY(-3px);
}

/* Dark Mode Toggle */
.aims-dark-mode-toggle {
    background: transparent;
    border: none;
    color: var(--secondary-bg);
    font-size: 24px;
    cursor: pointer;
    margin-left: 20px;
    padding: 5px 10px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.aims-dark-mode-toggle:hover {
    color: var(--bg-white);
    transform: scale(1.1);
}

/* Product Info Icon - Visible on all devices */
.aims-product-info-icon {
    display: block;
    width: fit-content;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1em;
    cursor: pointer;
    padding: 4px 8px;
    margin-top: 4px;
    transition: color 0.2s ease;
}

.aims-product-info-icon:hover {
    color: var(--primary-color);
}

/* Modal Overlay */
.aims-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.aims-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal */
.aims-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 8px 32px var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
}

.aims-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.aims-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.aims-modal-close:hover {
    background: var(--bg-gray);
    color: var(--text-color);
}

.aims-modal-content {
    font-size: 1em;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-right: 20px;
}

.aims-modal-table {
    font-size: 0.75em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.aims-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.aims-modal-header .aims-product-name {
    margin: 0;
    font-size: 1.2em;
}

.aims-modal-price-info {
    text-align: right;
    flex-shrink: 0;
}

.aims-modal-price-info .aims-product-price {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
}

.aims-modal-price-info .aims-product-category {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.aims-modal-content .aims-product-weight {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.aims-modal-description {
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* Desktop Horizontal Layout */
@media (min-width: 769px) {
    .aims-product-card {
        display: grid;
        grid-template-columns: auto auto 1fr auto auto;
        grid-template-rows: auto auto;
        padding: 8px 12px;
        gap: 4px 10px;
        align-items: center;
    }

    .aims-product-card:hover {
        transform: none;
    }

    /* Header uses display:contents so children participate in grid */
    .aims-product-header {
        display: contents;
    }

    /* Name section: full width on row 1 */
    .aims-product-header > div:first-child {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .aims-product-name {
        font-size: 0.9em;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
    }

    .aims-product-info-icon {
        flex-shrink: 0;
        margin-top: 0;
    }

    /* Price section: column 1 on row 2 */
    .aims-product-header > div:last-child {
        grid-column: 1;
        grid-row: 2;
        display: contents;
    }

    .aims-product-price {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.85em;
    }

    .aims-product-category {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.75em;
        margin-top: 0;
    }

    .aims-product-description {
        display: none;
    }

    .aims-product-weight {
        display: none;
    }

    /* Second row: price, category, quantity, subtotal, actions */
    .aims-product-quantity {
        grid-column: 3;
        grid-row: 2;
        margin-top: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-self: start;
    }

    .aims-product-quantity label {
        display: none;
    }

    .aims-product-subtotal {
        grid-column: 4;
        grid-row: 2;
        margin-top: 0;
        text-align: center;
        min-width: 60px;
        font-size: 0.9em;
    }

    .aims-product-actions {
        grid-column: 5;
        grid-row: 2;
        margin-top: 0;
    }

    .aims-quantity-input {
        width: 70px;
        padding: 6px;
        font-size: 0.85em;
    }

    .aims-qty-btn {
        width: 28px;
        height: 28px;
        font-size: 1em;
    }

    .aims-add-to-cart-btn,
    .aims-modify-btn,
    .aims-add-again-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    /* Hide button text on desktop horizontal, show icons */
    .aims-btn-text {
        display: none;
    }

    .aims-add-to-cart-btn,
    .aims-modify-btn,
    .aims-add-again-btn {
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .aims-add-to-cart-btn i,
    .aims-modify-btn i,
    .aims-add-again-btn i {
        margin: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .aims-order-form-wrapper {
        padding: 12px;
        max-width: 100%;
    }

    .aims-order-header h2 {
        font-size: 1.5em;
    }

    .aims-order-header p {
        font-size: 1em;
    }

    .aims-table-nav {
        padding: 15px;
        max-width: 100%;
    }

    .aims-table-nav-buttons {
        gap: 8px;
    }

    .aims-table-nav-btn {
        padding: 8px 14px;
        font-size: 0.85em;
    }

    .aims-products-grid {
        display: block !important;
    }

    .aims-group-products {
        display: block !important;
    }

    .aims-table-header {
        font-size: 1.2em;
        margin: 15px 0 6px 0;
        padding-bottom: 6px;
    }

    .aims-group-header {
        font-size: 1em;
        margin: 10px 0 6px 0;
    }

    /* Horizontal list item layout */
    .aims-product-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 8px 10px;
        margin-bottom: 6px;
        border-radius: 6px;
        gap: 8px;
    }

    .aims-product-header {
        flex: 1;
        min-width: 0;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0;
        gap: 6px;
    }

    .aims-product-header > div:first-child {
        flex: 1;
        min-width: 0;
    }

    .aims-product-quantity {
        flex: 0 0 auto;
        margin-top: 0;
        flex-direction: row;
        align-items: center;
    }

    .aims-product-quantity label {
        display: none;
    }

    .aims-product-subtotal {
        display: none;
    }

    .aims-product-actions {
        flex: 0 0 auto;
        margin-top: 0;
    }

    .aims-product-name {
        font-size: 0.95em;
        word-wrap: break-word;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        cursor: default;
        user-select: text;
    }

    /* Hide description in cards, show via modal */
    .aims-product-description {
        display: none !important;
    }

    /* Hide button text on mobile, show only icons */
    .aims-btn-text {
        display: none;
    }

    .aims-add-to-cart-btn,
    .aims-modify-btn,
    .aims-add-again-btn {
        min-width: 44px;
        padding: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .aims-add-to-cart-btn i,
    .aims-modify-btn i,
    .aims-add-again-btn i {
        margin: 0;
    }

    .aims-product-price {
        font-size: 0.95em;
    }

    .aims-product-category {
        font-size: 0.75em;
    }

    .aims-product-weight {
        font-size: 0.8em;
    }

    .aims-product-quantity {
        margin-top: 10px;
        gap: 5px;
        flex-wrap: wrap;
    }

    .aims-product-quantity label {
        font-size: 0.85em;
        width: 100%;
    }

    .aims-quantity-input {
        width: 70px;
        padding: 6px;
        font-size: 0.85em;
    }

    .aims-quantity-unit {
        font-size: 0.8em;
    }

    .aims-product-subtotal {
        font-size: 0.95em;
        margin-top: 8px;
    }

    .aims-product-actions {
        margin-top: 10px;
        gap: 6px;
    }

    .aims-modify-btn {
        min-width: 90px;
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .aims-add-again-btn {
        padding: 10px 16px;
        font-size: 0.85em;
    }

    .aims-add-to-cart-btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .aims-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .aims-filter-btn {
        width: 100%;
    }

    .aims-cart {
        padding: 18px;
        max-width: 100%;
    }

    .aims-cart-group {
        margin-bottom: 20px;
    }

    .aims-cart-group-header {
        font-size: 1.1em;
        margin-bottom: 12px;
        word-wrap: break-word;
    }

    .aims-cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
        max-width: 100%;
    }

    .aims-cart-item-edit-controls {
        width: 100%;
        gap: 6px;
    }

    .aims-cart-quantity-input {
        width: 70px;
        padding: 5px 6px;
        font-size: 0.9em;
    }

    .aims-cart-confirm-btn {
        width: 32px;
        height: 32px;
        font-size: 1em;
    }

    .aims-cart-quantity-unit,
    .aims-cart-unit-price {
        font-size: 0.8em;
    }

    .aims-cart-item-remove {
        align-self: flex-end;
    }

    .aims-cart-total {
        font-size: 1.1em;
        padding: 12px;
        max-width: 100%;
    }

    .aims-form {
        padding: 15px;
        max-width: 100%;
    }

    .aims-form-row input,
    .aims-form-row textarea {
        max-width: 100%;
    }

    .aims-btn-primary,
    .aims-btn-secondary {
        padding: 12px 24px;
        font-size: 1em;
    }

    .aims-floating-cart {
        width: 55px;
        height: 55px;
        font-size: 22px;
        bottom: 15px;
        right: 15px;
    }

    .aims-back-to-top {
        width: 45px;
        height: 45px;
        font-size: 20px;
        bottom: 80px;
        right: 15px;
    }

    .aims-dark-mode-toggle {
        font-size: 20px;
    }
}

/* Extra small devices (iPhone SE, etc) */
@media (max-width: 375px) {
    .aims-products-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .aims-product-card {
        padding: 10px;
        max-width: 100%;
        min-width: 0;
    }

    .aims-product-name {
        font-size: 0.9em;
        word-wrap: break-word;
    }
}
