/**
 * DiveClub Cart Styles - Header Button Only (No Side Bar)
 * Clean, modern design with NO vertical cart element
 */

:root {
    --cart-primary: #0891b2;
    --cart-primary-dark: #0e7490;
    --cart-accent: #06b6d4;
    --cart-success: #10b981;
    --cart-error: #ef4444;
    --cart-warning: #f59e0b;
    --cart-dark: #0f172a;
    --cart-text: #334155;
    --cart-text-light: #64748b;
    --cart-border: #e2e8f0;
    --cart-bg: #ffffff;
    --cart-bg-subtle: #f8fafc;
    --cart-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    --cart-radius: 16px;
    --cart-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   REMOVE ANY OLD CART BAR STYLES
   ============================================ */

.cart-bar,
#cart-bar,
.cart-bar-content,
.cart-bar-left,
.cart-bar-right,
.cart-icon-wrapper,
.cart-bar-text,
.expand-icon {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ============================================
   CART MODAL CONTAINER
   ============================================ */

.cart-modal-container {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    pointer-events: none;
    background: transparent;
}

.cart-modal-container * {
    pointer-events: auto;
}

/* ============================================
   CART OVERLAY
   ============================================ */

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9998;
}

.cart-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================
   CART PANEL - SIDE DRAWER
   ============================================ */

.cart-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    box-shadow: var(--cart-shadow);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

.cart-panel.hidden {
    transform: translateX(100%);
}

.cart-panel.expanded {
    transform: translateX(0);
}

/* Cart Panel Header */
.cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 2px solid var(--cart-border);
    flex-shrink: 0;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    color: white;
    position: relative;
}

.cart-close-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cart-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.cart-close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.cart-close-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* ============================================
   CHECKOUT STEPS
   ============================================ */

.cart-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.cart-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    transition: var(--cart-transition);
    font-size: 14px;
    font-weight: 500;
}

.cart-step.active {
    background: white;
    color: var(--cart-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-step.completed {
    background: var(--cart-success);
    color: white;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.cart-step.active .step-number {
    background: var(--cart-primary);
    color: white;
}

.cart-step.completed .step-number {
    background: rgba(255, 255, 255, 0.3);
}

.step-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.step-connector {
    width: 28px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    border-radius: 2px;
}

/* ============================================
   CART CONTENT
   ============================================ */

.cart-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    background: var(--cart-bg-subtle);
}

/* Smooth scrollbar */
.cart-content::-webkit-scrollbar {
    width: 8px;
}

.cart-content::-webkit-scrollbar-track {
    background: transparent;
}

.cart-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.cart-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Container for content */
.cart-items-container,
.checkout-form-container,
.payment-container {
    width: 100%;
    background: transparent;
}

/* Empty State */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    background: transparent;
}

.cart-empty .empty-icon {
    width: 100px;
    height: 100px;
    color: #cbd5e1;
    margin-bottom: 24px;
    opacity: 0.5;
}

.cart-empty h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--cart-dark);
    margin: 0 0 12px;
}

.cart-empty p {
    color: var(--cart-text-light);
    font-size: 15px;
    margin: 0;
    max-width: 320px;
    line-height: 1.6;
}

/* ============================================
   CART ITEMS
   ============================================ */

.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 16px;
    transition: var(--cart-transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid transparent;
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--cart-accent);
    transform: translateY(-2px);
}

.cart-item-image {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cart-accent) 0%, var(--cart-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-placeholder svg {
    width: 36px;
    height: 36px;
    color: white;
    opacity: 0.7;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--cart-dark);
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--cart-text-light);
    margin: 0 0 12px;
}

.cart-item-meta span {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: var(--cart-bg-subtle);
    border-radius: 6px;
}

.cart-item-pricing {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cart-item-unit {
    font-size: 13px;
    color: var(--cart-text-light);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--cart-bg-subtle);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--cart-border);
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--cart-primary);
    border-radius: 6px;
    transition: var(--cart-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--cart-primary);
    color: white;
    transform: scale(1.1);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-value {
    min-width: 32px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--cart-dark);
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.cart-item-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--cart-primary);
}

.cart-item-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: #fee2e2;
    cursor: pointer;
    color: #dc2626;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--cart-transition);
}

.cart-item-remove:hover {
    background: #fecaca;
    transform: scale(1.1);
}

.cart-item-remove:active {
    transform: scale(0.95);
}

.cart-item-remove svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   CART SUMMARY
   ============================================ */

.cart-summary {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-top: 16px;
    border: 2px solid var(--cart-border);
}

.cart-summary h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--cart-dark);
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--cart-border);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 15px;
    color: var(--cart-text);
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    margin-top: 12px;
    border-top: 2px solid var(--cart-border);
    font-size: 20px;
    font-weight: 700;
    color: var(--cart-dark);
}

.cart-summary-total span:last-child {
    color: var(--cart-primary);
    font-size: 24px;
}

/* ============================================
   CART ACTIONS
   ============================================ */

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid var(--cart-border);
}

.btn-clear {
    padding: 14px 24px;
    border: 2px solid var(--cart-border);
    background: white;
    color: var(--cart-text);
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--cart-transition);
    text-align: center;
}

.btn-clear:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-back {
    padding: 14px 24px;
    border: 2px solid var(--cart-border);
    background: white;
    color: var(--cart-text);
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--cart-transition);
}

.btn-back:hover {
    background: var(--cart-bg-subtle);
    border-color: var(--cart-primary);
    color: var(--cart-primary);
}

.btn-checkout,
.btn-submit {
    width: 100%;
    padding: 16px 32px;
    border: none;
    background: linear-gradient(135deg, var(--cart-primary) 0%, var(--cart-accent) 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--cart-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.btn-checkout:hover,
.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(8, 145, 178, 0.4);
}

.btn-checkout:active,
.btn-submit:active {
    transform: translateY(-1px);
}

.btn-checkout:disabled,
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-checkout svg,
.btn-submit svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   CHECKOUT FORM
   ============================================ */

.checkout-form,
.payment-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--cart-border);
}

.checkout-form h3,
.payment-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--cart-dark);
    margin: 0 0 10px;
}

.form-description {
    color: var(--cart-text-light);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.customer-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--cart-dark);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 14px;
    border: 2px solid var(--cart-border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--cart-dark);
    transition: var(--cart-transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--cart-primary);
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
}

.form-group input.error {
    border-color: var(--cart-error);
}

.error-message {
    font-size: 13px;
    color: var(--cart-error);
    margin-top: 6px;
    font-weight: 500;
}

/* ============================================
   PAYMENT STEP
   ============================================ */

.booking-summary {
    margin-bottom: 24px;
}

.summary-section {
    margin-bottom: 20px;
}

.summary-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--cart-dark);
    margin: 0 0 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 16px;
    background: var(--cart-bg-subtle);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--cart-border);
}

.summary-item-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-item-info strong {
    font-size: 15px;
    color: var(--cart-dark);
    font-weight: 600;
}

.summary-item-info span {
    font-size: 13px;
    color: var(--cart-text-light);
}

.summary-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--cart-primary);
}

.summary-total-section {
    border-top: 2px solid var(--cart-border);
    padding-top: 20px;
    margin-top: 16px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-total span:first-child {
    font-size: 16px;
    font-weight: 600;
    color: var(--cart-text);
}

.total-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--cart-primary);
}

.payment-notice {
    display: flex;
    gap: 14px;
    padding: 18px;
    background: #dbeafe;
    border-radius: 12px;
    margin-top: 20px;
    border: 2px solid #93c5fd;
}

.payment-notice svg {
    width: 22px;
    height: 22px;
    color: #3b82f6;
    flex-shrink: 0;
}

.payment-notice p {
    font-size: 14px;
    color: #1e40af;
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.cart-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.cart-loading.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--cart-border);
    border-top-color: var(--cart-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.cart-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 18px 24px;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    max-width: 420px;
    font-weight: 500;
}

.cart-notification.success {
    background: linear-gradient(135deg, var(--cart-success) 0%, #059669 100%);
}

.cart-notification.error {
    background: linear-gradient(135deg, var(--cart-error) 0%, #dc2626 100%);
}

.cart-notification button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cart-notification button:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .cart-panel {
        max-width: 100%;
    }

    .cart-panel-header {
        padding: 20px;
    }

    .cart-steps {
        gap: 4px;
    }

    .cart-step {
        padding: 8px 12px;
        font-size: 12px;
    }

    .step-label {
        display: none;
    }

    .step-connector {
        width: 20px;
    }

    .cart-content {
        padding: 16px;
    }

    .cart-item {
        flex-wrap: wrap;
        padding: 14px;
    }

    .cart-item-image {
        width: 75px;
        height: 75px;
    }

    .cart-item-details {
        flex: 1;
        min-width: calc(100% - 91px);
    }

    .cart-item-actions {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        padding-top: 12px;
        margin-top: 12px;
        border-top: 1px solid var(--cart-border);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .cart-actions {
        flex-direction: column;
    }

    .btn-back,
    .btn-clear {
        order: 2;
    }

    .btn-checkout,
    .btn-submit {
        order: 1;
    }

    .cart-notification {
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 24px;
    }
}

@media (max-width: 480px) {
    .cart-panel-header {
        padding: 16px;
    }

    .cart-content {
        padding: 12px;
    }

    .checkout-form,
    .payment-content {
        padding: 20px;
    }

    .cart-item {
        padding: 12px;
        gap: 12px;
    }
    
    .cart-summary {
        padding: 20px;
    }
}