/**
 * =====================================================
 * Sosyotik CP — Customer Panel Overrides
 * DS v3.0 üzerine müşteri paneline özel stiller
 * =====================================================
 */

/* =====================================================
   AUTH SCREEN
   ===================================================== */
.cp-auth-wrapper {
    max-width: 420px;
    margin: 60px auto;
    padding: 0 20px;
}

.cp-auth-card {
    background: var(--ds-white, #fff);
    border: 1px solid var(--ds-gray-150, #ececee);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
}

.cp-auth-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--ds-accent-light, rgba(79,70,229,0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.cp-auth-icon i {
    font-size: 28px;
    color: var(--ds-accent, #4f46e5);
}

.cp-auth-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--ds-gray-900, #18181b);
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.cp-auth-card p {
    font-size: 13px;
    color: var(--ds-gray-500, #71717a);
    margin: 0 0 28px;
}

/* Auth Tabs */
.cp-auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--ds-gray-100, #f4f4f5);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.cp-auth-tab {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ds-gray-500, #71717a);
    cursor: pointer;
    transition: all 0.2s;
}

.cp-auth-tab.active {
    background: var(--ds-white, #fff);
    color: var(--ds-gray-900, #18181b);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Auth Error */
.cp-auth-error {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--ds-danger-light, rgba(220,38,38,0.06));
    border: 1px solid var(--ds-danger-border, rgba(220,38,38,0.15));
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--ds-danger, #dc2626);
    text-align: left;
}

.cp-auth-error.active {
    display: flex;
}

.cp-auth-error i {
    font-size: 18px;
    flex-shrink: 0;
}

/* Form Groups */
.cp-form-group {
    margin-bottom: 16px;
    text-align: left;
}

.cp-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-gray-700, #3f3f46);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.cp-form-group input,
.cp-form-group textarea,
.cp-form-group select {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--ds-gray-200, #e4e4e7);
    border-radius: 10px;
    background: var(--ds-white, #fff);
    color: var(--ds-gray-900, #18181b);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.cp-form-group input:focus,
.cp-form-group textarea:focus,
.cp-form-group select:focus {
    border-color: var(--ds-accent, #4f46e5);
    box-shadow: 0 0 0 3px var(--ds-accent-ring, rgba(79,70,229,0.25));
}

.cp-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* =====================================================
   BUTTONS (DS token based)
   ===================================================== */
.cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.cp-btn-primary {
    background: var(--ds-accent, #4f46e5);
    color: #fff;
}

.cp-btn-primary:hover {
    background: var(--ds-accent-hover, #4338ca);
}

.cp-btn-outline {
    background: transparent;
    border: 1px solid var(--ds-gray-200, #e4e4e7);
    color: var(--ds-gray-700, #3f3f46);
}

.cp-btn-outline:hover {
    background: var(--ds-gray-50, #fafafa);
    border-color: var(--ds-gray-300, #d4d4d8);
}

.cp-btn-danger {
    background: var(--ds-danger-light);
    border: 1px solid var(--ds-danger-border);
    color: var(--ds-danger);
}

.cp-btn-danger:hover {
    background: var(--ds-danger);
    color: #fff;
}

.cp-btn-block {
    width: 100%;
}

.cp-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.cp-btn i {
    font-size: 16px;
}

/* =====================================================
   DASHBOARD — Profile Card
   ===================================================== */
.cp-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--ds-white, #fff);
    border: 1px solid var(--ds-gray-150, #ececee);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.cp-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--ds-accent, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.cp-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
}

.cp-profile-info {
    flex: 1;
    min-width: 0;
}

.cp-profile-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ds-gray-900, #18181b);
    letter-spacing: -0.2px;
}

.cp-profile-phone {
    font-size: 13px;
    color: var(--ds-gray-500, #71717a);
    margin-top: 2px;
}

.cp-profile-email {
    font-size: 12px;
    color: var(--ds-gray-400, #a1a1aa);
}

/* =====================================================
   ACTIVE ORDER BANNER
   ===================================================== */
.cp-active-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--ds-success-light, rgba(22,163,74,0.06));
    border: 1px solid var(--ds-success-border, rgba(22,163,74,0.15));
    border-radius: 12px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.cp-active-banner:hover {
    background: rgba(22,163,74,0.1);
}

.cp-active-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--ds-success, #16a34a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.cp-active-banner-text {
    flex: 1;
}

.cp-active-banner-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-gray-900, #18181b);
}

.cp-active-banner-text span {
    font-size: 12px;
    color: var(--ds-gray-500, #71717a);
}

.cp-active-banner-arrow {
    color: var(--ds-gray-400, #a1a1aa);
    font-size: 20px;
}

/* =====================================================
   NAVIGATION TABS
   ===================================================== */
.cp-nav {
    display: flex;
    gap: 4px;
    background: var(--ds-gray-100, #f4f4f5);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.cp-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--ds-gray-500, #71717a);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cp-nav-item.active {
    background: var(--ds-white, #fff);
    color: var(--ds-gray-900, #18181b);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.cp-nav-item i {
    font-size: 18px;
}

@media (max-width: 480px) {
    .cp-nav-item span:not(.cp-nav-item i) {
        font-size: 11px;
    }
    .cp-nav-item i {
        font-size: 16px;
    }
}

/* =====================================================
   SECTIONS
   ===================================================== */
.cp-section {
    display: none;
}

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

.cp-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-gray-900, #18181b);
    margin-bottom: 16px;
}

.cp-section-title i {
    font-size: 18px;
    color: var(--ds-accent, #4f46e5);
}

/* =====================================================
   ORDERS
   ===================================================== */
.cp-orders-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cp-filter-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--ds-gray-200, #e4e4e7);
    border-radius: 8px;
    background: var(--ds-white, #fff);
    color: var(--ds-gray-500, #71717a);
    cursor: pointer;
    transition: all 0.2s;
}

.cp-filter-btn.active {
    background: var(--ds-accent, #4f46e5);
    border-color: var(--ds-accent, #4f46e5);
    color: #fff;
}

/* Order Card */
.cp-order-card {
    background: var(--ds-white, #fff);
    border: 1px solid var(--ds-gray-150, #ececee);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.cp-order-card:hover {
    border-color: var(--ds-gray-300, #d4d4d8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cp-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cp-order-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-gray-900, #18181b);
}

.cp-order-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--ds-gray-100, #f4f4f5);
    color: var(--ds-gray-600, #52525b);
}

.cp-order-status.pending    { background: #fef3c7; color: #92400e; }
.cp-order-status.confirmed  { background: #dbeafe; color: #1e40af; }
.cp-order-status.preparing  { background: #e0e7ff; color: #3730a3; }
.cp-order-status.ready      { background: #d1fae5; color: #065f46; }
.cp-order-status.on_the_way { background: #cffafe; color: #155e75; }
.cp-order-status.delivered  { background: #dcfce7; color: #166534; }
.cp-order-status.cancelled  { background: #fee2e2; color: #991b1b; }

.cp-order-tenant {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.cp-order-tenant-logo {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.cp-order-tenant-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-gray-700, #3f3f46);
}

.cp-order-items {
    font-size: 12px;
    color: var(--ds-gray-500, #71717a);
    margin-bottom: 10px;
    line-height: 1.5;
}

.cp-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--ds-gray-100, #f4f4f5);
}

.cp-order-date {
    font-size: 12px;
    color: var(--ds-gray-400, #a1a1aa);
}

.cp-order-total {
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-gray-900, #18181b);
}

.cp-orders-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--ds-gray-400, #a1a1aa);
}

.cp-orders-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.cp-orders-empty p {
    font-size: 14px;
    margin: 0;
}

/* =====================================================
   ADDRESSES
   ===================================================== */
.cp-address-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--ds-white, #fff);
    border: 1px solid var(--ds-gray-150, #ececee);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
}

.cp-address-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--ds-accent-light, rgba(79,70,229,0.06));
    color: var(--ds-accent, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.cp-address-info {
    flex: 1;
    min-width: 0;
}

.cp-address-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-gray-900, #18181b);
    margin-bottom: 4px;
}

.cp-address-label .default-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--ds-accent-light, rgba(79,70,229,0.06));
    color: var(--ds-accent, #4f46e5);
    margin-left: 6px;
    vertical-align: middle;
}

.cp-address-text {
    font-size: 12px;
    color: var(--ds-gray-500, #71717a);
    line-height: 1.5;
}

.cp-address-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* =====================================================
   CARD BLOCKS
   ===================================================== */
.cp-card {
    background: var(--ds-white, #fff);
    border: 1px solid var(--ds-gray-150, #ececee);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 16px;
}

/* =====================================================
   TOGGLE ROW (Notification Preferences)
   ===================================================== */
.cp-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ds-gray-100, #f4f4f5);
}

.cp-toggle-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cp-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-gray-900, #18181b);
}

.cp-toggle-desc {
    font-size: 12px;
    color: var(--ds-gray-500, #71717a);
    margin-top: 2px;
}

.cp-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    border: none;
    border-radius: 12px;
    background: var(--ds-gray-300, #d4d4d8);
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.cp-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cp-toggle.active {
    background: var(--ds-accent, #4f46e5);
}

.cp-toggle.active::after {
    transform: translateX(20px);
}

/* =====================================================
   DRAWERS / OVERLAYS
   ===================================================== */
.cp-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.cp-detail-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cp-detail-drawer {
    width: 480px;
    max-width: 90vw;
    background: var(--ds-white, #fff);
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cp-detail-overlay.active .cp-detail-drawer {
    transform: translateX(0);
}

.cp-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ds-gray-100, #f4f4f5);
    flex-shrink: 0;
}

.cp-detail-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--ds-gray-900, #18181b);
}

.cp-detail-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: var(--ds-gray-100, #f4f4f5);
    color: var(--ds-gray-600, #52525b);
    cursor: pointer;
    transition: all 0.2s;
}

.cp-detail-close:hover {
    background: var(--ds-gray-200, #e4e4e7);
}

.cp-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Detail rows */
.cp-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
}

.cp-detail-row-label {
    color: var(--ds-gray-500, #71717a);
}

.cp-detail-row-value {
    font-weight: 600;
    color: var(--ds-gray-900, #18181b);
    text-align: right;
}

.cp-detail-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 0;
    margin-top: 10px;
    border-top: 2px solid var(--ds-gray-200, #e4e4e7);
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-gray-900, #18181b);
}

.cp-detail-total .value {
    color: var(--ds-accent, #4f46e5);
}

/* Detail items */
.cp-detail-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--ds-gray-50, #fafafa);
}

.cp-detail-item-qty {
    font-weight: 700;
    color: var(--ds-accent, #4f46e5);
    min-width: 30px;
}

.cp-detail-item-name {
    flex: 1;
    color: var(--ds-gray-800, #27272a);
    line-height: 1.5;
}

.cp-detail-item-price {
    font-weight: 600;
    color: var(--ds-gray-900, #18181b);
    white-space: nowrap;
}

/* Status Timeline */
.cp-detail-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 16px 8px;
    margin-bottom: 16px;
    background: var(--ds-gray-50, #fafafa);
    border-radius: 12px;
}

.cp-detail-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.cp-detail-step-line {
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--ds-gray-200, #e4e4e7);
    z-index: 0;
}

.cp-detail-step.completed .cp-detail-step-line {
    background: var(--ds-accent, #4f46e5);
}

.cp-detail-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ds-gray-200, #e4e4e7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: all 0.3s;
}

.cp-detail-step-dot i {
    font-size: 14px;
    color: var(--ds-gray-400, #a1a1aa);
}

.cp-detail-step.completed .cp-detail-step-dot {
    background: var(--ds-accent, #4f46e5);
}

.cp-detail-step.completed .cp-detail-step-dot i {
    color: #fff;
}

.cp-detail-step.current .cp-detail-step-dot {
    background: var(--ds-accent, #4f46e5);
    box-shadow: 0 0 0 4px var(--ds-accent-ring, rgba(79,70,229,0.25));
}

.cp-detail-step.current .cp-detail-step-dot i {
    color: #fff;
}

.cp-detail-step-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--ds-gray-400, #a1a1aa);
    margin-top: 6px;
    text-align: center;
    white-space: nowrap;
}

.cp-detail-step.completed .cp-detail-step-label,
.cp-detail-step.current .cp-detail-step-label {
    color: var(--ds-accent, #4f46e5);
}

/* =====================================================
   LOADING & EMPTY STATES
   ===================================================== */
.cp-loading {
    text-align: center;
    padding: 48px 20px;
    color: var(--ds-gray-400, #a1a1aa);
    font-size: 14px;
}

.cp-loading i {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
    animation: cpSpin 1s linear infinite;
}

@keyframes cpSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cp-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--ds-gray-400, #a1a1aa);
}

.cp-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.cp-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ds-gray-700, #3f3f46);
    margin: 0 0 6px;
}

.cp-empty p {
    font-size: 13px;
    margin: 0;
}

/* =====================================================
   LOAD MORE BUTTON
   ===================================================== */
.cp-load-more {
    text-align: center;
    padding: 16px 0;
}

/* =====================================================
   CONTENT CONTAINER
   ===================================================== */
.cp-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* =====================================================
   HEADER PROFILE OVERRIDES
   ===================================================== */
.cp-header-profile .ds-header-dropdown {
    right: 0;
}

.cp-avatar-sm {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    background: var(--ds-accent, #4f46e5) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cp-login-btn {
    display: flex !important;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-accent, #4f46e5);
    white-space: nowrap;
}

.cp-login-btn-text {
    display: inline;
}

@media (max-width: 480px) {
    .cp-login-btn-text {
        display: none;
    }
}

/* =====================================================
   RESPONSIVE — Mobile adjustments
   ===================================================== */
@media (max-width: 768px) {
    .cp-container {
        padding: 16px 12px;
    }

    .cp-auth-wrapper {
        margin: 20px auto;
    }

    .cp-auth-card {
        padding: 28px 20px;
    }

    .cp-profile-card {
        padding: 16px;
    }

    .cp-address-card {
        flex-wrap: wrap;
    }

    .cp-address-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}
