/* JupitERP - Main Stylesheet */
/* Shared and frontend-only styles. Admin-only styles are in admin.css */

/* ===== CSS Variables ===== */
:root {
    --border-radius: 5px;
    --border-radius-badge: 15px;
}

/* ===== Dynamic Design Colors with Gradients ===== */
/*
 * IMPORTANT: The following elements have DYNAMIC background gradients
 * that are set in /app/views/partials/public_layout_start.php based on
 * admin-configurable design settings from the database:
 *
 * - .navbar:not(.admin-top-navbar)       -> nav_background gradient
 * - .hero-section                        -> hero_background gradient
 * - footer.bg-dark                       -> footer_background gradient
 * - .hot-deals-section, .badge-hot       -> hot_deals_background gradient
 * - .new-arrivals-section, .badge-new    -> new_arrivals_background gradient
 *
 * Each gradient uses linear-gradient(135deg, baseColor 0%, lighterColor 100%)
 * The lighter color is automatically calculated at 15% lighter than base color.
 *
 * To modify these colors, use: Admin -> Settings -> Design
 */

/* ===== Public Navigation Bar ===== */
.navbar:not(.admin-top-navbar) {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar:not(.admin-top-navbar) .navbar-brand,
.navbar:not(.admin-top-navbar) .nav-link {
    color: #2c3e50 !important;
}

.navbar:not(.admin-top-navbar) .nav-link:hover {
    color: #1e3c72 !important;
}

.navbar:not(.admin-top-navbar) .nav-link.active {
    color: #2a5298 !important;
    font-weight: 600;
}

.navbar:not(.admin-top-navbar) .dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navbar:not(.admin-top-navbar) .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.1);
}

.navbar:not(.admin-top-navbar) .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===== Auth Pages (Login, Registration, Password Reset) ===== */
.auth-page {
    --hero-bg: #667eea; /* Default, overridden by inline style */
    background: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.auth-card {
    max-width: 450px;
    margin: 2rem auto;
}

.auth-page .card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.auth-page .card-header {
    background: var(--hero-bg);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 2rem;
    text-align: center;
}

.auth-page .card-header h2 {
    margin: 0;
    font-weight: 600;
}

.auth-page .card-body {
    padding: 2rem;
}

.auth-page .form-label {
    font-weight: 500;
    color: #495057;
}

.auth-page .form-control:focus {
    border-color: var(--hero-bg);
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.1);
}

.auth-page .btn-primary {
    background: var(--hero-bg);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: transform 0.2s;
}

.auth-page .btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(0.9);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.auth-page .alert {
    border-radius: var(--border-radius);
    border: none;
}

.auth-page .password-wrapper,
.register-page .password-wrapper {
    position: relative;
}

.auth-page .password-toggle,
.register-page .password-toggle {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #6c757d;
    background: #f8f9fa;
    border-left: 1px solid #ced4da;
    border-radius: 0 0.375rem 0.375rem 0;
}

.auth-page .password-toggle:hover,
.register-page .password-toggle:hover {
    color: #495057;
    background: #e9ecef;
}

.auth-page .links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-page .links a {
    color: var(--hero-bg);
    text-decoration: none;
    display: block;
    margin: 0.5rem 0;
}

.auth-page .links a:hover {
    text-decoration: underline;
}

/* Back link for auth pages */
.auth-page .back-link {
    text-align: center;
    margin-top: 1rem;
}

.auth-page .back-link a {
    color: var(--hero-bg);
    text-decoration: none;
}

.auth-page .back-link a:hover {
    text-decoration: underline;
}

/* Success card for auth pages (password reset success, etc.) */
.auth-page .success-card {
    max-width: 550px;
    margin: 2rem auto;
}

.auth-page .success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.auth-page .success-icon.animate-envelope {
    animation: register-envelope 0.8s ease-in-out;
}

.auth-page .info-text {
    font-size: 1.1rem;
    color: #495057;
    margin: 1.5rem 0;
}

.auth-page .email-highlight {
    color: var(--hero-bg);
    font-weight: 600;
}

.auth-page .info-box {
    background: #e7f3ff;
    border-left: 4px solid var(--hero-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    text-align: left;
}

.auth-page .info-box ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.auth-page .info-box li {
    margin: 0.5rem 0;
    color: #495057;
}

/* Success header variant (green, for password reset success, etc.) */
.auth-page .card-header.success-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.auth-page .success-icon.animate-checkmark {
    animation: auth-checkmark 0.8s ease-in-out;
}

@keyframes auth-checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Password requirements validation list */
.password-requirements {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.password-requirements ul {
    margin: 0.5rem 0 0 0;
    padding-left: 0;
    list-style: none;
}

.password-requirements li {
    margin: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.password-requirements li.valid {
    color: #28a745;
}

.password-requirements li.invalid {
    color: #dc3545;
}

.password-requirements li::before {
    position: absolute;
    left: 0;
    font-family: 'bootstrap-icons';
    font-weight: bold;
}

.password-requirements li.valid::before {
    content: "\f26b";
    color: #28a745;
}

.password-requirements li.invalid::before {
    content: "\f659";
    color: #dc3545;
}

/* ===== Register Pages ===== */
.register-page {
    --hero-bg: #667eea; /* Default, overridden by inline style */
    background: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.register-page.centered {
    justify-content: center;
    padding: 2rem 0;
}

.register-page .register-container {
    max-width: 550px;
    width: 100%;
    padding: 20px;
}

.register-page .register-card {
    max-width: 600px;
    margin: 2rem auto;
}

.register-page .register-card.wide {
    max-width: 700px;
}

.register-page .register-card-simple {
    background: white;
    border-radius: var(--border-radius);
    padding: 3rem 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.register-page .card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.register-page .card-header {
    background: var(--hero-bg);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 2rem;
    text-align: center;
}

.register-page .card-header h2 {
    margin: 0;
    font-weight: 600;
}

.register-page .card-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

.register-page .card-body {
    padding: 2rem;
}

.register-page .card-body.text-center {
    text-align: center;
}

.register-page .form-label {
    font-weight: 500;
    color: #495057;
}

.register-page .form-floating {
    margin-bottom: 1rem;
}

.register-page .form-control:focus,
.register-page .form-select:focus {
    border-color: var(--hero-bg);
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.1);
}

.register-page .btn-primary {
    background: var(--hero-bg);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: transform 0.2s;
}

.register-page .btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(0.9);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.register-page .alert {
    border-radius: var(--border-radius);
    border: none;
}

/* Brand logo section (simple register form) */
.register-page .brand-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.register-page .brand-logo i {
    font-size: 4rem;
    color: var(--hero-bg);
}

.register-page .brand-logo h2 {
    color: #343a40;
    margin-top: 1rem;
    font-weight: 600;
}

/* Step indicator */
.register-page .step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.register-page .step {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin: 0 0.5rem;
    position: relative;
}

.register-page .step.active {
    background: var(--hero-bg);
    color: white;
}

.register-page .step.completed {
    background: #28a745;
    color: white;
}

.register-page .step:not(:last-child)::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 2px;
    background: #e9ecef;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
}

.register-page .step.completed:not(:last-child)::after {
    background: #28a745;
}

.register-page .step.pending {
    background: #e9ecef;
    color: #6c757d;
}

.register-page .step.pending::after {
    background: #e9ecef;
}

.register-page .step.in-progress {
    background: #fd7e14;
    color: white;
}

.register-page .step.in-progress::after {
    background: #e9ecef;
}

/* User info box */
.register-page .user-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.register-page .user-info strong {
    color: var(--hero-bg);
}

/* Section headers */
.register-page .section-header {
    font-weight: 600;
    color: var(--hero-bg);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Form check inputs */
.register-page .form-check-input:checked {
    background-color: var(--hero-bg);
    border-color: var(--hero-bg);
}

/* Back link */
.register-page .back-link {
    text-align: center;
    margin-top: 1rem;
}

.register-page .back-link a {
    color: var(--hero-bg);
    text-decoration: none;
}

.register-page .back-link a:hover {
    text-decoration: underline;
}

/* Password strength indicator */
.register-page .password-strength {
    height: 5px;
    border-radius: var(--border-radius);
    margin-top: 0.5rem;
    transition: all 0.3s;
}

.register-page .strength-weak {
    background: #dc3545;
    width: 33%;
}

.register-page .strength-medium {
    background: #ffc107;
    width: 66%;
}

.register-page .strength-strong {
    background: #28a745;
    width: 100%;
}

/* Divider */
.register-page .divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.register-page .divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #dee2e6;
}

.register-page .divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    color: #6c757d;
}

/* Social login buttons */
.register-page .social-login {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.register-page .social-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.register-page .social-btn:hover {
    border-color: var(--hero-bg);
    background: #f8f9fa;
}

/* Footer links */
.register-page .footer-links {
    text-align: center;
    margin-top: 1.5rem;
}

.register-page .footer-links a {
    color: var(--hero-bg);
    text-decoration: none;
}

.register-page .footer-links a:hover {
    text-decoration: underline;
}

/* Benefits box */
.register-page .benefits {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.register-page .benefits ul {
    margin: 0;
    padding-left: 1.5rem;
}

.register-page .benefits li {
    margin-bottom: 0.5rem;
}

/* Success pages */
.register-page .success-card {
    max-width: 550px;
    margin: 2rem auto;
}

.register-page .success-card.wide {
    max-width: 600px;
}

.register-page .success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.register-page .success-icon.large {
    font-size: 5rem;
}

@keyframes register-envelope {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes register-checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.register-page .success-icon.animate-envelope {
    animation: register-envelope 0.8s ease-in-out;
}

.register-page .success-icon.animate-checkmark {
    animation: register-checkmark 0.8s ease-in-out;
}

.register-page .info-text {
    font-size: 1.1rem;
    color: #495057;
    margin: 1.5rem 0;
}

.register-page .email-highlight {
    color: var(--hero-bg);
    font-weight: 600;
}

.register-page .info-box {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    text-align: left;
}

.register-page .info-box ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.register-page .info-box li {
    margin: 0.5rem 0;
    color: #495057;
}

.register-page .user-details {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    text-align: left;
}

.register-page .user-details strong {
    color: var(--hero-bg);
}

/* ===== Main Content Area ===== */
.main-content {
    padding: 2rem;
}

/* Public pages - adjust padding for no sidebar */
.public-page .main-content {
    padding: 2rem 0;
}

/* ===== Tables ===== */
.table-hover tbody tr {
    transition: background-color 0.2s;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.table-actions {
    white-space: nowrap;
    text-align: right;
}

.table-actions .btn {
    margin-right: 0.25rem;
}

.table-actions .btn:disabled {
    opacity: 0.3;
}

/* Actions dropdown menu (3-dots menu) */
.actions-dropdown-wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    position: relative;
}

.actions-dropdown {
    min-width: 200px;
    padding: 0.5rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.1);
    z-index: 1050;
}

/* Allow dropdown to overflow table-responsive container */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible !important;
}

/* Ensure dropdown appears above other elements */
.table-responsive .dropdown-menu.show,
.data-table-card .dropdown-menu.show {
    z-index: 1050;
}

/* Allow dropdown overflow in table containers */
.data-table-card .table-responsive {
    overflow: visible;
}

.actions-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.actions-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

.actions-dropdown .dropdown-item i {
    width: 1.25rem;
    text-align: center;
}

.actions-dropdown .dropdown-divider {
    margin: 0.25rem 0;
}

/* ===== Unified Stat Cards - Design 4: Colored Header ===== */
.stat-card, .stats-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}
/* Clickable stat cards (links or onclick handlers) */
.stat-card.clickable, .stats-card.clickable,
a.stat-card, a.stats-card {
    cursor: pointer;
}
.stat-card.clickable:hover, .stats-card.clickable:hover,
a.stat-card:hover, a.stats-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}
.stat-card .stat-header, .stats-card .stat-header {
    padding: 0.2rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-card .stat-header .stat-icon, .stats-card .stat-header .stat-icon {
    font-size: 1.25rem;
    opacity: 0.85;
    color: inherit;
    order: 2;
}
.stat-card .stat-header .stat-label, .stats-card .stat-header .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    font-weight: 600;
    color: inherit;
}
.stat-card .stat-body, .stats-card .stat-body {
    padding: 0.65rem 0.75rem;
}
.stat-card .stat-body .stat-value, .stats-card .stat-body .stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: #212529;
}
.stat-card .stat-body small, .stats-card .stat-body small {
    font-size: 0.75rem;
    color: #6c757d;
}
/* Header color variants */
.stat-card.primary .stat-header, .stats-card.primary .stat-header { background: linear-gradient(135deg, #007bff 0%, #0056b3 100%); color: #fff; }
.stat-card.success .stat-header, .stats-card.success .stat-header { background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%); color: #fff; }
.stat-card.warning .stat-header, .stats-card.warning .stat-header { background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%); color: #212529; }
.stat-card.danger .stat-header, .stats-card.danger .stat-header { background: linear-gradient(135deg, #dc3545 0%, #c82333 100%); color: #fff; }
.stat-card.info .stat-header, .stats-card.info .stat-header { background: linear-gradient(135deg, #17a2b8 0%, #138496 100%); color: #fff; }
.stat-card.secondary .stat-header, .stats-card.secondary .stat-header { background: linear-gradient(135deg, #6c757d 0%, #545b62 100%); color: #fff; }
.stat-card.dark .stat-header, .stats-card.dark .stat-header { background: linear-gradient(135deg, #343a40 0%, #1d2124 100%); color: #fff; }
.stat-card.preorder .stat-header, .stats-card.preorder .stat-header { background: linear-gradient(135deg, #6f42c1 0%, #8b5cf6 100%); color: #fff; }
.bg-preorder { background: linear-gradient(135deg, #6f42c1 0%, #8b5cf6 100%) !important; }
/* Compact stat card for dual values */
.stat-card.stat-card-compact .stat-body {
    padding: 0.5rem 1rem;
}
.stat-card .stat-value-dual {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #212529;
}
.stat-card .stat-value-dual small {
    font-size: 0.7rem;
    color: #6c757d;
}

/* ===== Badges ===== */
.badge-new {
    background: #28a745;
}

.badge-sale {
    background: #dc3545;
}

.badge-hot {
    background: #ff6b6b;
}

.badge-featured {
    background: #ffc107;
    color: #000;
}

.badge-low-stock {
    background: #fd7e14;
}

.badge-out-of-stock {
    background: #6c757d;
}

/* ===== Buttons ===== */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.required-field::after {
    content: ' *';
    color: #dc3545;
}

/* Read-only fields: visually distinct from editable ones */
.form-control[readonly] {
    background-color: #f0f3f7;
    color: #495057;
    cursor: not-allowed;
    border-style: dashed;
}

/* ===== Product Cards ===== */
.product-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
/*    padding-top: 100%; */
    background: #f8f9fa;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.product-card .product-info {
    padding: 1rem;
}

.product-card .product-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card .product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #667eea;
}

.product-card .product-price-old {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 1rem;
    margin-right: 0.5rem;
}

/* ===== Shopping Cart ===== */
.cart-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.cart-summary {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.cart-summary .summary-total {
    font-size: 1.5rem;
    font-weight: bold;
    border-top: 2px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* ===== Cart Summary Table ===== */
.cart-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.cart-summary-table td {
    padding: 0.25rem 0;
    vertical-align: top;
    border: 0;
}

.cart-summary-table td:first-child {
    padding-right: 0.75rem;
}

.cart-summary-table td:last-child {
    text-align: right;
}

.cart-summary-table td:last-child .price-block .price-main,
.cart-summary-table td:last-child .price-block .price-secondary {
    text-align: right;
}

/* ===== Order Status Timeline ===== */
.order-timeline {
    position: relative;
    padding-left: 2rem;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.order-timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.order-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dee2e6;
    border: 3px solid white;
}

.order-timeline-item.active::before {
    background: #667eea;
}

.order-timeline-item.completed::before {
    background: #28a745;
}

/* ===== Loading Spinner ===== */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* ===== Alerts & Notifications ===== */
.alert {
    border-radius: var(--border-radius);
    border: none;
}

.alert-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Responsive Utilities ===== */
@media (max-width: 575.98px) {
    /* Ensure consistent horizontal breathing room on small screens,
       overriding any page-level padding: 2rem 0 shorthand */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (max-width: 767.98px) {
    .auth-card {
        margin: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    /* Touch-friendly minimum tap target size (WCAG 2.5.5) */
    .input-group .btn,
    .quantity-btn {
        min-width: 44px;
        min-height: 44px;
    }

    /* Producer offer modal: reduce image height when stacked on mobile */
    #producerOfferModal .modal-body .col-md-5 > div {
        min-height: 150px !important;
    }

    /* Announcement modal: reduce image height when stacked on mobile */
    #announcementModal .modal-body .col-md-5 > div {
        min-height: 150px !important;
    }
}

/* ===== Utility Classes ===== */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm-hover {
    transition: box-shadow 0.2s;
}

.shadow-sm-hover:hover {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.overflow-hidden {
    overflow: hidden;
}

/* ===== Membership Pages ===== */
/* Shared styles for all membership pages (tiers, benefits, requests) */
.membership-page body {
    background: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.membership-page .main-content {
    padding: 2rem;
}

.membership-page .card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Tier badges */
.tier-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}

/* Tier filter radio buttons (benefits page) */
.tier-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tier-radio {
    display: none;
}

.tier-radio-label {
    padding: 0.5rem 1.25rem;
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius-badge);
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    font-weight: 500;
}

.tier-radio-label:hover {
    border-color: #0d6efd;
    background: #f8f9fa;
}

.tier-radio:checked + .tier-radio-label {
    border-color: #0d6efd;
    background: #0d6efd;
    color: white;
}

.tier-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

/* Request cards (requests page) */
.request-card {
    border-left: 5px solid;
    transition: all 0.3s;
}

.request-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.request-pending {
    border-left-color: #ffc107;
}

.request-approved {
    border-left-color: #28a745;
}

.request-rejected {
    border-left-color: #dc3545;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-badge);
    font-weight: bold;
}

/* Filter tabs (requests page) */
.filter-tabs .nav-link {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    color: #495057;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    margin-right: 0.25rem;
}

.filter-tabs .nav-link:hover {
    background: #dee2e6;
    color: #212529;
}

.filter-tabs .nav-link.active {
    background: white;
    border-bottom-color: white;
    color: #0d6efd;
    font-weight: 600;
}

/* Table hover effect for membership pages */
.membership-page .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* ===== Image Modal (80% Viewport) ===== */
.modal-image-80 .modal-dialog {
    width: 80vw;
    max-width: 80vw;
    height: 80vh;
    max-height: 80vh;
}

.modal-image-80 .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-image-80 .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-80 .modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ===== Print Styles ===== */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}

/* GDPR Toast sizing */
.gdpr-toast-sizing {
    max-width: 450px !important;
}

@media (max-width: 767.98px) {
    .gdpr-toast-sizing {
        width: 100% !important;
        max-width: calc(100vw - 2rem) !important;
    }
}

/* ===== Toast and Modal z-index ===== */
.toast-container-top {
    z-index: 99999;
}

.modal-high-z {
    z-index: 9999;
}

/* ===== Address Map Module ===== */
.address-map-icon {
    color: #6c757d;
    transition: color 0.2s;
    vertical-align: middle;
}

.address-map-icon:hover {
    color: #0d6efd;
}

#addressMapContainer {
    border-radius: 0;
}

#addressMapModal .modal-body {
    min-height: 200px;
}

/* ===== Product Category Sidebar - Mobile Collapsible Subcategories ===== */
.subcategory-toggle {
    cursor: pointer;
    padding: 0.5rem 0.25rem;
    color: #6c757d;
    transition: color 0.2s;
    position: absolute;
    right: 0;
}

.subcategory-toggle:hover {
    color: #2a5298;
}

/* ===== Maintenance Mode Banner ===== */
.maintenance-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1f2937;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

body:has(.maintenance-mode-banner) {
    padding-top: 40px;
}

/* ===== Demo Mode Banner ===== */

.demo-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1061;
    background: linear-gradient(135deg, #f59e0b, #e67e22);
    color: #1f2937;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.demo-mode-banner__icon {
    font-size: 1rem;
    flex-shrink: 0;
}

body:has(.demo-mode-banner) {
    padding-top: 40px;
}

body:has(.demo-mode-banner):has(.maintenance-mode-banner) {
    padding-top: 80px;
}

/* ===== Demo Blocked Page ===== */

.demo-blocked-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.demo-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 3rem 2.5rem;
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.demo-badge {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.demo-icon {
    font-size: 4rem;
    color: #f59e0b;
    margin-bottom: 1.5rem;
}

.demo-logo {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
    margin-bottom: 1.5rem;
}

.demo-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.demo-body {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.back-link {
    font-size: 0.9rem;
    color: #6b7280;
    text-decoration: none;
}

.back-link:hover {
    color: #374151;
}

/* ===== Unified Search / Filter System ===== */

/* Active filter chips */
.unified-search-chips {
    min-height: 2rem;
}

.unified-chip {
    background-color: #e7f1ff;
    color: #0a58ca;
    border: 1px solid #b6d4fe;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.15s, border-color 0.15s;
}

.unified-chip:hover {
    background-color: #cfe2ff;
    border-color: #9ec5fe;
    color: #084298;
    text-decoration: none;
}

.unified-chip .bi-x {
    font-size: 0.75rem;
    opacity: 0.7;
}

.unified-chip-clear {
    font-size: 0.8rem;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.unified-chip-clear:hover {
    opacity: 1;
}

/* Horizontal filter bar */
.unified-search-horizontal {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
}

/* Vertical sidebar filters */
.unified-search-vertical .unified-search-form {
    padding: 0;
}

/* Offcanvas sidebar */
.unified-search-offcanvas {
    max-width: 320px;
}

/* Range input group */
.unified-search-range .input-group-text {
    min-width: 2.5rem;
    justify-content: center;
    font-size: 0.8rem;
}

/* ── Promotions page ──────────────────────────────────────────────── */
.promotions-hero {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.promotions-hero::before {
    content: '🏷️';
    font-size: 15rem;
    position: absolute;
    right: -50px;
    top: -50px;
    opacity: 0.1;
    pointer-events: none;
}

.promotion-banner {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
}

/* ── Install wizard ───────────────────────────────────────────────── */
.install-container {
    max-width: 800px;
    margin: 50px auto;
}

.install-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.install-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    color: #343a40;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.install-header h1 {
    color: #343a40;
}

.install-header p {
    color: #6c757d;
}

.install-body {
    padding: 40px;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: -1;
}

.step:last-child::after {
    display: none;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.step.active .step-number {
    background: #0d6efd;
    color: white;
}

.step.completed .step-number {
    background: #28a745;
    color: white;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

.alert-box {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.install-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.install-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.install-checklist li:last-child {
    border-bottom: none;
}

.install-checklist .check-icon {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
}

.install-checklist .check-label {
    flex: 1;
}

.install-checklist .check-error {
    display: block;
    font-size: 0.78rem;
    color: #dc3545;
    margin-top: 2px;
}

/* ===== Webshop-Disabled Landing Page ===== */
.wd-hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--color-primary, #2a5298);
}

.wd-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.wd-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.wd-hero-inner {
    position: relative;
    z-index: 1;
    padding: 4rem 1rem;
}

.wd-hero-logo {
    max-height: 80px;
    width: auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.wd-hero-brand {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.wd-hero-headline {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.wd-hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.wd-cta-admin {
    border-radius: 2rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.wd-features {
    background: var(--color-secondary, #f8f9fa);
}

.wd-feature-icon {
    color: var(--color-primary, #2a5298);
}

.wd-icon-accent {
    color: var(--color-accent, #e63946);
}

.wd-contact-info a {
    color: inherit;
    text-decoration: none;
}

.wd-contact-info a:hover {
    text-decoration: underline;
}

.wd-legal-links a {
    text-decoration: none;
}

.wd-legal-links a:hover {
    text-decoration: underline;
}

@media (max-width: 767.98px) {
    .wd-hero-headline {
        font-size: 1.75rem;
    }

    .wd-hero {
        min-height: 60vh;
    }
}

/* ============================================================
   Price display blocks — price_display-driven rendering
   Used by format_price_block() Twig function and PriceService
   ============================================================ */
.price-block {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.3;
}

.price-block .price-main {
    font-weight: 700;
}

.price-block .price-secondary {
    font-size: 0.8em;
    opacity: 0.65;
    font-weight: 400;
}

.price-login-prompt {
    display: inline-block;
    font-size: 0.875em;
}

.price-login-prompt a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.8;
}

.price-login-prompt a:hover {
    opacity: 1;
}

/* ── Category cards ───────────────────────────────────────────────────────── */
.category-card {
    position: relative;
    display: flex;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: .5rem;
    text-decoration: none;
    color: #fff;
    transition: transform .15s ease;
}
.category-card:hover {
    transform: translateY(-3px);
    color: #fff;
}
.category-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.category-card__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .75rem;
}
.category-card:not(.category-card--noimg) .category-card__body {
    margin-top: auto;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
}
.category-card--noimg {
    background: var(--color-primary, #2a5298);
    justify-content: center;
    align-items: center;
}
.category-card--noimg .category-card__body {
    text-align: center;
    align-items: center;
}
.category-card__title {
    display: block;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.2;
}
.category-card__count {
    display: block;
    font-size: .8rem;
    opacity: .85;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* ── Product Gallery (shared PDP partial) ──────────────────────────────────── */
.pdp-gallery__main img { width: 100%; border-radius: .375rem; }
.pdp-thumb {
    background: none;
    border: 2px solid transparent;
    border-radius: .25rem;
    padding: 2px;
    cursor: pointer;
    transition: border-color .15s;
}
.pdp-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: .2rem; display: block; }
.pdp-thumb:hover, .pdp-thumb.active { border-color: var(--bs-primary, #0d6efd); }

/* ── Variant Picker (shared PDP partial) ────────────────────────────────────── */
.variant-picker__axis .variant-opt-btn.active {
    font-weight: 600;
}
/* ─────────────────────────────────────────────────────────────────────────── */
