/**
 * ==================================================================================
 * BABYLUGG PHASE 2 - Core Features
 * ==================================================================================
 * - Booking Flow Redesign mit Progress Indicator
 * - Product Grid Modernisierung
 * - Navigation Improvements
 * ==================================================================================
 */

/* ==================== BOOKING FLOW REDESIGN ==================== */

/* Progress Indicator */
.booking-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0 24px;
    margin: 0 auto;
    max-width: 700px;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
    z-index: 2;
}

.progress-step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #F1F3F4;
    border: 3px solid #DADCE0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #80868B;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.progress-step.active .progress-step-circle {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 6px rgba(42, 159, 135, 0.12),
                0 4px 12px rgba(42, 159, 135, 0.3);
    transform: scale(1.1);
}

.progress-step.completed .progress-step-circle {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.progress-step-label {
    font-size: 13px;
    font-weight: 500;
    color: #5F6368;
    text-align: center;
    max-width: 90px;
}

.progress-step.active .progress-step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-step.completed .progress-step-label {
    color: var(--success-color);
}

.progress-line {
    position: absolute;
    top: 22px;
    left: 0;
    right: 0;
    height: 3px;
    background: #DADCE0;
    z-index: 1;
}

.progress-line-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(42, 159, 135, 0.4);
}

/* Booking Steps Modernisierung */
.booking-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.booking-step {
    background: white;
    border: 2px solid #F1F3F4;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.booking-step:not(.is-disabled) {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(42, 159, 135, 0.1);
}

.booking-step.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.booking-step h4 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.booking-step h4::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Delivery Options */
.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delivery-options label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #DADCE0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.delivery-options label:hover {
    border-color: var(--primary-color);
    background: rgba(42, 159, 135, 0.04);
}

.delivery-options input[type="radio"]:checked + label,
.delivery-options label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(42, 159, 135, 0.08);
    box-shadow: 0 2px 8px rgba(42, 159, 135, 0.15);
}

.delivery-options input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

#pickup-info {
    background: var(--light-background);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 12px;
    border-left: 4px solid var(--primary-color);
}

.pickup-times {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.pickup-times label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.pickup-times select {
    width: 100%;
}

/* Customer Details Grid */
.customer-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .customer-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Price Summary Modernisierung */
.price-summary {
    background: var(--light-background);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    border: 2px solid #DADCE0;
}

.price-summary p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    font-size: 15px;
}

.price-summary p:has(b) {
    font-size: 18px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #DADCE0;
}

.price-summary strong {
    color: var(--primary-color);
    font-size: 16px;
}

.price-summary hr {
    margin: 16px 0;
    border: none;
    height: 2px;
    background: #DADCE0;
}

/* Payment Options */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.payment-options label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #DADCE0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.payment-options label:hover {
    border-color: var(--primary-color);
    background: rgba(42, 159, 135, 0.04);
}

.payment-options input[type="radio"]:checked + label,
.payment-options label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(42, 159, 135, 0.08);
    box-shadow: 0 2px 8px rgba(42, 159, 135, 0.15);
}

/* Coupon Container */
.coupon-container {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.coupon-container input {
    flex: 1;
}

/* Booking Confirmation View */
#booking-confirmation-view {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

#booking-confirmation-view.active {
    display: block;
    animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#booking-confirmation-view svg {
    margin: 0 auto 24px;
    animation: checkmarkDraw 0.6s ease forwards;
}

@keyframes checkmarkDraw {
    0% {
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* ==================== PRODUCT GRID MODERNISIERUNG ==================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Modern Product Card */
.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06),
                0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #F1F3F4;
    position: relative;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12),
                0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-6px);
    border-color: transparent;
}

/* Product Image Container */
.product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #F8F9FA;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image-container img {
    transform: scale(1.08);
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: white;
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.product-badge.popular {
    background: var(--primary-color);
    color: white;
}

.product-badge.new {
    background: var(--secondary-color);
    color: white;
}

/* Quick Actions Overlay */
.product-quick-actions {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

.product-card:hover .product-quick-actions {
    opacity: 1;
    transform: translateY(0);
}

.quick-action-btn {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.quick-action-btn i {
    margin-right: 6px;
}

/* Product Content */
.product-content {
    padding: 20px;
}

.product-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-description {
    font-size: 14px;
    color: #5F6368;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product Footer */
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #F1F3F4;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.product-price-period {
    font-size: 13px;
    font-weight: 500;
    color: #80868B;
}

.product-availability {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 16px;
}

.product-availability.available {
    background: rgba(39, 174, 96, 0.12);
    color: var(--success-color);
}

.product-availability.limited {
    background: rgba(249, 171, 0, 0.12);
    color: #F9AB00;
}

.product-availability.unavailable {
    background: rgba(192, 57, 43, 0.12);
    color: var(--danger-color);
}

/* ==================== NAVIGATION MODERNISIERUNG ==================== */

/* Glassmorphism Top Navigation */
.main-header {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

/* Mobile Bottom Navigation (iOS Style) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    display: none;
    grid-template-columns: repeat(4, 1fr);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
    z-index: 999;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: grid;
    }

    /* Add padding to body to account for bottom nav */
    body {
        padding-bottom: calc(65px + env(safe-area-inset-bottom));
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    color: #80868B;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.bottom-nav-item:active {
    transform: scale(0.9);
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 3px 3px;
}

.bottom-nav-item i {
    font-size: 22px;
    transition: transform 0.2s ease;
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item span {
    font-size: 11px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

/* Category Tabs Modernisierung */
.category-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 10px 20px;
    background: white;
    border: 2px solid #DADCE0;
    border-radius: 24px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-tab:hover {
    border-color: var(--primary-color);
    background: rgba(42, 159, 135, 0.04);
}

.category-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(42, 159, 135, 0.25);
}

/* Filter Container Modernisierung */
.filter-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 250px;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #DADCE0;
    border-radius: 24px;
    font-size: 15px;
    background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2380868B" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>') no-repeat 14px center;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 159, 135, 0.1);
    outline: none;
}

.sort-by select {
    padding: 12px 16px;
    border: 2px solid #DADCE0;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-by select:hover {
    border-color: var(--primary-color);
}

.sort-by select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 159, 135, 0.1);
    outline: none;
}

/* ==================== MODAL IMPROVEMENTS ==================== */

.modal {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #F1F3F4;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */

@media (max-width: 768px) {
    .booking-progress {
        padding: 24px 0 16px;
    }

    .progress-step-circle {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .progress-step-label {
        font-size: 11px;
        max-width: 70px;
    }

    .booking-step {
        padding: 20px;
    }

    .booking-step h4 {
        font-size: 16px;
    }

    .price-summary {
        padding: 20px;
    }

    .product-grid {
        gap: 16px;
    }

    .filter-container {
        flex-direction: column;
    }

    .search-bar {
        min-width: 100%;
    }
}

/* ==================== ACCESSIBILITY ==================== */

@media (prefers-reduced-motion: reduce) {
    .product-card,
    .booking-step,
    .bottom-nav-item,
    .progress-step-circle {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card,
    .booking-step,
    .bottom-nav {
        border-width: 2px;
    }
}
