/* Sidebar Container */
.sidebar {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
    overflow: hidden;
}

@media (max-width: 991px) {
    .sidebar {
        width: 100%;
        border: none;
        border-bottom: 2px solid #e0e0e0;
        position: sticky;
        top: 57px;
        overflow-x: auto;
        box-shadow: none;
        border-radius: 0;
        z-index: 25;
    }
}

.sidebar-header {
    padding: 20px;
    background: #008230;
    color: white;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.sidebar-header h1 i {
    margin-right: 8px;
}

.sidebar-subheader {
    padding: 12px 20px;
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-subheader i {
    margin-right: 6px;
    color: #008230;
}

/* Step Progress Bar */
.step-progress {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #fff;
    flex: 1;
}

@media (max-width: 991px) {
    .step-progress {
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .step-progress::-webkit-scrollbar {
        height: 4px;
    }

    .step-progress::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .step-progress::-webkit-scrollbar-thumb {
        background: #008230;
        border-radius: 4px;
    }
}

.step-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s;
    cursor: pointer;
}

.step-item:hover {
    background: #f8f9fa;
}

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

@media (max-width: 991px) {
    .step-item {
        flex-direction: column;
        min-width: 90px;
        flex: 1;
        padding: 14px 10px;
        text-align: center;
        gap: 6px;
    }

    .step-item.active {
        padding-bottom: 11px;
    }
}

.step-item.active {
    background: #e7f5ec;
}

.step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 600 14px/1 inherit;
    transition: all 0.3s;
}

.step-item.active .step-number {
    background: #008230;
    color: white;
}

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

.step-item.completed .step-number::after,
.step-item.invalid .step-number::after {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.step-item.completed .step-number::after {
    content: '✓';
    background: #28a745;
}

.step-item.invalid .step-number {
    background: #dc3545;
    color: #fff;
}

/* Validation Indicator */
.step-validation-icon {
    margin-left: auto;
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-item.validated .step-validation-icon {
    opacity: 1;
}

.step-item.validated.valid .step-validation-icon {
    color: #28a745;
}

.step-item.validated.invalid .step-validation-icon {
    color: #dc3545;
}

@media (max-width: 991px) {
    .step-validation-icon {
        font-size: 16px;
        position: absolute;
        top: 10px;
        right: 15px;
        margin: 0;
    }

    .step-item {
        position: relative;
    }
}

.step-item.completed:hover {
    background: #e7f5ec;
}

.step-item.completed:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 130, 48, 0.3);
}

.step-item.completed:hover .step-label {
    color: #008230;
}

.step-label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    flex: 1;
}

.step-item.active .step-label {
    color: #008230;
    font-weight: 600;
}

.step-item.completed .step-label {
    color: #28a745;
}

@media (max-width: 991px) {
    .step-label {
        font-size: 12px;
        text-align: center;
        line-height: 1.3;
        word-break: break-word;
        hyphens: auto;
    }

    .step-number {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 15px;
    }
}

/* Content Area */
.content {
    padding: 30px;
    min-height: 500px;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* Order Container */
#order {
    width: 100%;
    padding: 0;
}

#order>div {
    background-color: #ffffff;
}

@media (max-width: 991px) {
    #order>div:not(.order-summary-mobile-top) {
        margin-top: 2.5rem;
    }

    #order>.order-summary-mobile-top+#contCart {
        margin-top: 0;
    }
}

@media (min-width: 992px) {
    #order>div:not(#contCart) {
        margin-top: 2.5rem;
    }
}

#order>div:first-child {
    margin-top: 0;
}

/* Cart Container Styling */
#contCart {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Products styling */
/* Desktop: artikel in row direction */
.artikel {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

/* Mobile: artikel in column direction with contPrice below contProduct */
@media (max-width: 1199.98px) {
    .artikel {
        flex-direction: column !important;
    }

    .contPrice {
        margin-top: 1rem;
        align-self: stretch !important;
        width: 100% !important;
    }
}

/* Modern quantity select styling */
.updateAnzahl {
    min-width: 65px;
    padding: 8px 32px 8px 12px !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    font-weight: 600;
    color: #374151;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px !important;
}

.updateAnzahl:hover {
    border-color: #008230 !important;
}

/* Delete button styling */
.btnDeleteProduct {
    padding: 8px 12px !important;
    border: 1.5px solid #fee2e2 !important;
    border-radius: 8px !important;
    background-color: #fef2f2 !important;
    color: #dc2626;
    transition: all 0.2s ease;
}

.btnDeleteProduct:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Contact Form Styling */
.contContact {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.contContact .d-flex[style*="border-bottom"]:last-of-type {
    border-bottom: none !important;
}

.contContact .bg-light {
    background: #f8f9fa !important;
}

.contContact .d-flex .bg-light[style*="border-right"] {
    border-right: 1px solid #e0e0e0 !important;
}

.contContact .d-flex>.bg-light i {
    color: #008230;
    font-size: 18px;
}

/* Main Flex Container */
.order-container-wrapper {
    display: flex;
    flex-direction: row-reverse;
    gap: 20px;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

@media (max-width: 991px) {

    /* Mobile: Stack sidebar above content */
    .order-container-wrapper {
        max-width: 100%;
        flex-direction: column;
        gap: 0;
        padding: 0 20px 20px 20px;
    }

    #order {
        flex: 1;
        max-width: 100%;
    }
}

/* Calendar highlight animation */
.calendar-highlight {
    animation: pulseHighlight 1.5s ease-in-out 1;
}

@keyframes pulseHighlight {
    0% {
        background-color: rgba(255, 193, 7, 0);
    }

    50% {
        background-color: rgba(255, 193, 7, 0.15);
    }

    100% {
        background-color: rgba(255, 193, 7, 0);
    }
}

@media (min-width: 992px) {
    .appointment-grid {
        grid-template-columns: 2fr 2fr !important;
    }
}

/* Calendar Container Styling */
#contCalendar {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Sidebar Wrapper for grouping sidebar and summary */
.sidebar-wrapper {
    min-width: 350px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 77px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Order Summary Box */
.order-summary-box {
    background: #fff;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.order-summary-content {
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.summary-row:last-child {
    padding-bottom: 0;
}

.summary-label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.summary-value {
    font-size: 16px;
    color: #212529;
    white-space: nowrap;
    font-weight: 600;
}

.summary-total .summary-label {
    font-weight: 600;
}

.summary-total .summary-value {
    font-size: 20px;
    color: #008230;
}

.order-summary-box .btn {
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
    transition: all 0.3s;
}

.order-summary-box .btn:hover {
    background-color: #ffb300;
    border-color: #ffb300;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Delete Warenkorb button - Desktop only */
.deleteWarenkorbDesktop {
    border-radius: 24px !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
    transition: all 0.3s !important;
}

.deleteWarenkorbDesktop:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.5) !important;
}

/* Hide mobile summary boxes on desktop */
.order-summary-mobile {
    display: none;
}

@media (max-width: 991px) {
    .order-summary-desktop {
        display: none;
    }

    .order-summary-mobile {
        display: block;
        background: #fff;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
        border-radius: 8px;
        padding: 16px;
        margin: 16px 0;
    }

    .order-summary-mobile-top {
        order: -1;
    }

    .order-summary-mobile-bottom {
        margin-bottom: 0;
    }

    .sidebar-wrapper {
        width: 100%;
        position: sticky;
        top: 57px;
        z-index: 50;
        background: #fff;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .order-summary-mobile .order-summary-content {
        margin-bottom: 12px;
    }

    .order-summary-mobile .summary-row {
        padding: 8px 0;
    }

    .order-summary-mobile .summary-label {
        font-size: 13px;
    }

    .order-summary-mobile .summary-value {
        font-size: 15px;
    }

    .order-summary-mobile .summary-total .summary-value {
        font-size: 18px;
    }

    .order-summary-mobile .btn {
        font-size: 15px;
        padding: 10px 16px;
    }
}

/* Empty Cart Container */
.empty-cart-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
}

.empty-cart-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #e7f5ec 0%, #d4edda 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.empty-cart-icon i {
    font-size: 42px;
    color: #008230;
}

.empty-cart-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.empty-cart-message {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 30px;
}

.empty-cart-btn {
    background: #008230;
    border-color: #008230;
    border-radius: 24px;
    padding: 14px 32px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.empty-cart-btn:hover {
    background: #006928;
    border-color: #006928;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 130, 48, 0.3);
}

/* Empty Cart Mobile */
@media (max-width: 991px) {
    .empty-cart-container {
        padding: 40px 24px;
        max-width: none;
        border-radius: 10px;
    }

    .empty-cart-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }

    .empty-cart-icon i {
        font-size: 32px;
    }

    .empty-cart-title {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .empty-cart-message {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .empty-cart-btn {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
    }
}