/**
 * Car Wash Booking - Single Page Layout Styles (Enhanced)
 * Accordion-style single page form with improved UI/UX
 */

/* ========================================
   SINGLE PAGE LAYOUT - FULL WIDTH
   ======================================== */

.cwb-booking-single {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
}

/* Container for content */
.cwb-booking-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Progress Bar */
.cwb-progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.cwb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cwb-primary-color, #2271b1) 0%, var(--cwb-primary-dark, #135e96) 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.cwb-progress-text {
    text-align: center;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 30px;
    font-weight: 500;
}

.cwb-current-step {
    color: var(--cwb-primary-color, #2271b1);
    font-weight: 700;
    font-size: 15px;
}

/* ========================================
   ACCORDION SECTIONS - FIXED BORDERS
   ======================================== */

.cwb-section {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.cwb-section.active {
    border-color: var(--cwb-primary-color, #2271b1);
    box-shadow: 0 8px 24px rgba(34, 113, 177, 0.12);
}

.cwb-section.completed {
    border-color: #10b981;
}

/* Section Header */
.cwb-section-header {
    display: flex;
    align-items: center;
    padding: 24px 28px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    border-radius: 10px 10px 0 0;
    position: relative;
}

.cwb-section-header:hover {
    background: #f8f9fa;
}

.cwb-section.active .cwb-section-header {
    background: linear-gradient(135deg, #f0f6fc 0%, #e3f2fd 100%);
    border-bottom: 1px solid #e0e0e0;
}

.cwb-section:not(.active) .cwb-section-header {
    border-radius: 10px;
}

.cwb-section-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    margin-right: 18px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cwb-section.active .cwb-section-number {
    background: var(--cwb-primary-color, #2271b1);
    color: white;
    transform: scale(1.05);
}

.cwb-section.completed .cwb-section-number {
    background: #10b981;
    color: white;
}

.cwb-section.completed .cwb-section-number::before {
    content: '✓';
}

.cwb-section-title {
    flex: 1;
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: #1a202c;
}

.cwb-section-status {
    margin-right: 15px;
    font-size: 13px;
    color: #6c757d;
}

.cwb-section.completed .cwb-section-status::after {
    content: '✓ Completed';
    color: #10b981;
    font-weight: 600;
    font-size: 14px;
}

.cwb-section-toggle {
    font-size: 14px;
    color: #6c757d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
}

.cwb-section.active .cwb-section-toggle {
    transform: rotate(180deg);
}

.cwb-section-content {
    padding: 28px;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   PACKAGES - HORIZONTAL GRID LAYOUT
   ======================================== */

.cwb-vehicle-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* UPDATED: Horizontal Grid Layout for Packages */
.cwb-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.cwb-vehicle-card,
.cwb-package-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cwb-vehicle-card {
    text-align: center;
    padding: 24px;
}

/* UPDATED: Vertical Card Layout */
.cwb-package-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100%;
}

.cwb-vehicle-card:hover,
.cwb-package-card:hover {
    border-color: var(--cwb-primary-color, #2271b1);
    box-shadow: 0 8px 24px rgba(34, 113, 177, 0.12);
    transform: translateY(-2px);
}

.cwb-vehicle-card.selected,
.cwb-package-card.selected {
    border-color: var(--cwb-primary-color, #2271b1);
    background: linear-gradient(135deg, #f0f6fc 0%, #e3f2fd 100%);
    box-shadow: 0 8px 24px rgba(34, 113, 177, 0.18);
}

.cwb-package-card.selected::before {
    content: '✓';
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.cwb-vehicle-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.cwb-vehicle-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.cwb-vehicle-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin: 10px 0 5px 0;
}

.cwb-vehicle-desc {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

/* UPDATED: Package Image */
.cwb-package-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    background: #f8f9fa;
}

.cwb-package-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cwb-package-card:hover .cwb-package-image img {
    transform: scale(1.05);
}

/* UPDATED: Package Content */
.cwb-package-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.cwb-package-name {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.cwb-package-description {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 16px 0;
    line-height: 1.6;
    flex-grow: 0;
}

.cwb-package-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.cwb-package-features li {
    padding: 6px 0 6px 24px;
    position: relative;
    font-size: 14px;
    color: #4a5568;
    line-height: 1.5;
}

.cwb-package-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
    font-size: 16px;
}

/* UPDATED: Package Footer */
.cwb-package-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.cwb-package-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cwb-price-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.cwb-price-amount {
    font-size: 26px;
    font-weight: 800;
    color: var(--cwb-primary-color, #2271b1);
    line-height: 1;
}

.cwb-package-duration {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #6c757d;
    padding: 8px 14px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    font-weight: 500;
}

.cwb-package-duration span:first-child {
    font-size: 16px;
}

/* ========================================
   FORM STYLING - ENHANCED
   ======================================== */

.cwb-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.cwb-form-group {
    display: flex;
    flex-direction: column;
}

.cwb-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cwb-required {
    color: #ef4444;
    font-weight: 700;
}

.cwb-optional {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

.cwb-input,
.cwb-select,
.cwb-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    color: #1a202c;
    transition: all 0.2s ease;
    background: white;
}

.cwb-input:focus,
.cwb-select:focus,
.cwb-textarea:focus {
    outline: none;
    border-color: var(--cwb-primary-color, #2271b1);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.cwb-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.cwb-input::placeholder,
.cwb-textarea::placeholder {
    color: #9ca3af;
}

/* Form Actions */
.cwb-form-actions {
    margin-top: 32px;
    text-align: center;
}

.cwb-btn {
    padding: 14px 40px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cwb-btn-primary {
    background: var(--cwb-primary-color, #2271b1);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.2);
}

.cwb-btn-primary:hover:not(:disabled) {
    background: var(--cwb-primary-dark, #135e96);
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.3);
    transform: translateY(-2px);
}

.cwb-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Loading State */
.cwb-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .cwb-booking-single {
        padding: 30px 15px;
    }

    .cwb-packages-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .cwb-booking-single {
        padding: 20px 10px;
    }

    .cwb-section-header {
        padding: 18px 20px;
    }

    .cwb-section-content {
        padding: 20px;
    }

    .cwb-section-title {
        font-size: 16px;
    }

    .cwb-section-number {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .cwb-packages-grid {
        grid-template-columns: 1fr;
    }

    .cwb-package-image {
        height: 180px;
    }

    .cwb-package-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cwb-form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cwb-price-amount {
        font-size: 24px;
    }

    .cwb-package-name {
        font-size: 18px;
    }

    .cwb-package-image {
        height: 160px;
    }
}

/* ========================================
   DYNAMIC COLUMN CLASSES
   ======================================== */

/* Package Grid Columns */
.cwb-packages-cols-1 {
    grid-template-columns: 1fr !important;
}

.cwb-packages-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.cwb-packages-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.cwb-packages-cols-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* Addon Grid Columns */
.cwb-addons-cols-1 {
    grid-template-columns: 1fr !important;
}

.cwb-addons-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.cwb-addons-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.cwb-addons-cols-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* ========================================
   ADDON DISPLAY MODES
   ======================================== */

/* Grid Mode (Default) */
.cwb-addons-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.cwb-addon-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cwb-addon-item:hover {
    border-color: var(--cwb-primary-color, #2271b1);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.12);
}

.cwb-addon-item.selected {
    border-color: var(--cwb-primary-color, #2271b1);
    background: linear-gradient(135deg, #f0f6fc 0%, #e3f2fd 100%);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.18);
}

.cwb-addon-checkbox {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cwb-addon-content {
    flex: 1;
    display: flex;
    gap: 16px;
}

.cwb-addon-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.cwb-addon-info {
    flex: 1;
}

.cwb-addon-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 6px 0;
}

.cwb-addon-description {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.cwb-addon-meta {
    display: flex;
    gap: 16px;
    align-items: center;
}

.cwb-addon-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--cwb-primary-color, #2271b1);
}

.cwb-addon-duration {
    font-size: 14px;
    color: #6c757d;
}

/* Table Mode */
.cwb-addons-table {
    margin-top: 20px;
}

.cwb-addon-table-layout {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
}

.cwb-addon-row {
    background: white;
    border: 2px solid #e0e0e0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.cwb-addon-row:hover {
    border-color: var(--cwb-primary-color, #2271b1);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.12);
}

.cwb-addon-row.selected {
    border-color: var(--cwb-primary-color, #2271b1);
    background: linear-gradient(135deg, #f0f6fc 0%, #e3f2fd 100%);
}

.cwb-addon-row td {
    padding: 16px;
    vertical-align: middle;
    border-top: 2px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
}

.cwb-addon-row td:first-child {
    border-left: 2px solid #e0e0e0;
    border-radius: 8px 0 0 8px;
}

.cwb-addon-row td:last-child {
    border-right: 2px solid #e0e0e0;
    border-radius: 0 8px 8px 0;
}

.cwb-addon-row:hover td {
    border-color: var(--cwb-primary-color, #2271b1);
}

.cwb-addon-row.selected td {
    border-color: var(--cwb-primary-color, #2271b1);
}

.cwb-addon-checkbox-cell {
    width: 40px;
    text-align: center;
}

.cwb-addon-icon-cell {
    width: 60px;
}

.cwb-addon-icon-cell img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.cwb-addon-info-cell {
    flex: 1;
}

.cwb-addon-info-cell label {
    cursor: pointer;
    display: block;
}

.cwb-addon-price-cell {
    font-size: 16px;
    font-weight: 700;
    color: var(--cwb-primary-color, #2271b1);
    white-space: nowrap;
}

.cwb-addon-duration-cell {
    font-size: 14px;
    color: #6c757d;
    white-space: nowrap;
}

/* List Mode */
.cwb-addons-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cwb-addon-list-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 16px;
}

.cwb-addon-list-item:hover {
    border-color: var(--cwb-primary-color, #2271b1);
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.12);
}

.cwb-addon-list-item.selected {
    border-color: var(--cwb-primary-color, #2271b1);
    background: linear-gradient(135deg, #f0f6fc 0%, #e3f2fd 100%);
}

.cwb-addon-list-item .cwb-addon-icon {
    width: 40px;
    height: 40px;
}

.cwb-addon-list-item .cwb-addon-info {
    flex: 1;
}

.cwb-addon-list-item .cwb-addon-meta {
    margin-left: auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* Compact Mode */
.cwb-addons-compact {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cwb-addon-compact-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cwb-addon-compact-item:hover {
    border-color: var(--cwb-primary-color, #2271b1);
    background: #f8f9fa;
}

.cwb-addon-compact-item.selected {
    border-color: var(--cwb-primary-color, #2271b1);
    background: linear-gradient(135deg, #f0f6fc 0%, #e3f2fd 100%);
}

.cwb-addon-compact-item .cwb-addon-name {
    flex: 1;
    font-size: 15px;
    margin: 0;
}

.cwb-addon-compact-item .cwb-addon-price {
    font-size: 15px;
    font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    .cwb-packages-cols-3,
    .cwb-packages-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .cwb-addons-cols-3,
    .cwb-addons-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .cwb-addon-table-layout {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {

    .cwb-packages-cols-2,
    .cwb-packages-cols-3,
    .cwb-packages-cols-4 {
        grid-template-columns: 1fr !important;
    }

    .cwb-addons-cols-2,
    .cwb-addons-cols-3,
    .cwb-addons-cols-4 {
        grid-template-columns: 1fr !important;
    }

    .cwb-addon-list-item {
        flex-wrap: wrap;
    }

    .cwb-addon-list-item .cwb-addon-meta {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        margin-left: 0;
    }
}

/* ========================================
   BOOKING SUMMARY CARD - ENHANCED
   ======================================== */

.cwb-booking-summary-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-top: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.cwb-summary-header {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cwb-summary-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 20px 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.cwb-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.cwb-summary-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cwb-summary-item .cwb-total-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--cwb-primary-color, #2271b1);
    line-height: 1;
}

.cwb-summary-item .cwb-total-duration {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.cwb-summary-divider {
    width: 2px;
    height: 50px;
    background: linear-gradient(180deg, transparent 0%, #e2e8f0 20%, #e2e8f0 80%, transparent 100%);
}

/* Step Navigation Buttons */
.cwb-step-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.cwb-btn-secondary {
    background: white;
    color: #475569;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cwb-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cwb-btn-icon {
    font-size: 16px;
    line-height: 1;
}

/* Responsive Adjustments for Summary Card */
@media (max-width: 768px) {
    .cwb-summary-row {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .cwb-summary-divider {
        width: 80%;
        height: 2px;
        background: linear-gradient(90deg, transparent 0%, #e2e8f0 20%, #e2e8f0 80%, transparent 100%);
    }

    .cwb-step-navigation {
        flex-direction: column;
    }

    .cwb-step-navigation .cwb-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .cwb-booking-summary-card {
        padding: 20px 16px;
        margin-top: 24px;
    }

    .cwb-summary-item .cwb-total-price {
        font-size: 24px;
    }

    .cwb-summary-item .cwb-total-duration {
        font-size: 20px;
    }
}