/* ========================================
   Lightning McClean V2 — Mini Calculator Widget + Chores Page
   Uses v2 design tokens throughout
   ======================================== */

/* ==========================================
   MINI CALCULATOR SIDEBAR WIDGET
   ========================================== */

.mini-calc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.mini-calc__service-badge {
    background: var(--gradient-blue);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 10px 16px;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-calc__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(30, 64, 175, 0.05);
}

.mini-calc__header span {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.mini-calc__toggle {
    background: none;
    border: none;
    color: var(--primary-light);
    cursor: pointer;
    font-size: 12px;
    padding: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.mini-calc__toggle:hover {
    background: rgba(59, 130, 246, 0.1);
}

@media (max-width: 1023px) {
    .mini-calc__toggle {
        display: block;
    }
}

/* Collapse / Expand */
.mini-calc__body {
    padding: 18px;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
}

.mini-calc__body.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Input Groups */
.mc-group {
    margin-bottom: 14px;
}

.mc-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.mc-label i {
    color: var(--primary-light);
    font-size: 12px;
}

/* Property Toggle */
.mc-prop-toggle {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mc-prop-btn {
    flex: 1;
    padding: 10px 10px;
    min-height: 44px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: var(--transition);
    white-space: nowrap;
    touch-action: manipulation;
}

.mc-prop-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.mc-prop-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Sqft Input */
.mc-sqft-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-input {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 12px;
    min-height: 44px;
    font-size: 16px;
    font-family: var(--font-primary);
    width: 100%;
    transition: var(--transition);
}

.mc-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.mc-sqft-unit {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Counter */
.mc-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mc-counter-btn {
    width: 44px;
    height: 44px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    color: var(--primary-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
    touch-action: manipulation;
}

.mc-counter-btn:hover {
    background: var(--primary-light);
    color: var(--white);
}

.mc-counter-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 24px;
    text-align: center;
}

/* Select */
.mc-select {
    width: 100%;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 12px;
    min-height: 44px;
    font-size: 16px;
    font-family: var(--font-primary);
    transition: var(--transition);
}

.mc-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Add-ons */
.mc-addons-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mc-addon-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px 10px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    touch-action: manipulation;
}

.mc-addon-check:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.04);
}

.mc-addon-check input[type="checkbox"] {
    accent-color: var(--primary-light);
    width: 18px;
    height: 18px;
}

/* Divider */
.mini-calc__divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

/* Price Display */
.mini-calc__result {
    text-align: center;
    padding: 14px 0 10px;
    border-top: 1px solid var(--border);
    margin-bottom: 14px;
}

.mini-calc__price-wrap {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
}

.mini-calc__currency {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-light);
}

.mini-calc__amount {
    font-size: 46px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.mini-calc__range {
    display: none;
}

/* CTAs */
.mini-calc .btn {
    font-size: 13px;
    padding: 10px 16px;
    min-height: 44px;
}

.mini-calc .btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

/* ==========================================
   CHORES PAGE STYLES
   ========================================== */

/* Layout */
.chores-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}

/* Hero Badges */
.chores-hero-badges {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.chores-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
}

.chores-badge i {
    font-size: 11px;
}

/* Chore Categories */
.chore-category {
    margin-bottom: 48px;
}

.chore-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--primary-light);
}

.chore-category-icon {
    width: 44px;
    height: 44px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 18px;
    flex-shrink: 0;
}

.chore-category-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Chore Cards Grid */
.chore-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* Individual Chore Card */
.chore-card {
    position: relative;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
    user-select: none;
    display: block;
    touch-action: manipulation;
}

.chore-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.chore-card.selected {
    border-color: var(--primary-light);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 1px var(--primary-light);
}

.chore-card.selected .chore-check {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--white);
}

.chore-card.selected .chore-check i {
    display: block;
}

/* Hidden actual checkbox */
.chore-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Visual checkbox */
.chore-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chore-check i {
    display: none;
    font-size: 10px;
    color: var(--white);
    font-weight: 700;
}

.chore-card-body {
    padding-right: 28px;
}

.chore-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.chore-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.chore-price-tag {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.chore-price-tag .dollar {
    font-size: 13px;
    color: var(--primary-light);
    vertical-align: super;
    margin-right: 1px;
}

/* Info Note */
.chores-info-note {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 20px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.chores-info-note i {
    color: var(--primary-light);
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.chores-info-note a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Order Summary Panel */
.chores-summary-wrap {
    position: sticky;
    top: 90px;
}

.chores-summary {
    background: #ffffff;
    border: 1px solid rgba(30, 64, 175, 0.12);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.1);
}

.summary-header {
    background: var(--gradient-blue);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.summary-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-count {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}

.summary-body {
    padding: 20px;
}

.summary-list-wrap {
    min-height: 60px;
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.summary-list-wrap::-webkit-scrollbar {
    width: 4px;
}

.summary-list-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.summary-list-wrap::-webkit-scrollbar-thumb {
    background: rgba(30, 64, 175, 0.2);
    border-radius: 2px;
}

#choresSelectedList {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.chores-empty {
    font-size: 13px;
    color: var(--gray-400);
    text-align: center;
    padding: 16px;
    font-style: italic;
}

.chores-selected-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--dark);
    padding: 7px 10px;
    background: rgba(30, 64, 175, 0.04);
    border-radius: var(--radius-sm);
    gap: 8px;
}

.chores-item-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

/* Summary Totals */
.summary-divider {
    height: 1px;
    background: rgba(30, 64, 175, 0.1);
    margin: 14px 0;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--gray-500);
}

.summary-line.total {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-top: 4px;
}

.summary-line .amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
}

.summary-line.total .amount {
    font-size: 28px;
    color: var(--accent);
}

.summary-min-note {
    font-size: 11px;
    color: var(--gray-500);
    font-style: italic;
    display: none;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    text-align: center;
}

.summary-cta {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-cta .btn {
    font-size: 14px;
    padding: 12px 16px;
}

.summary-cta .btn:disabled,
.summary-cta .btn[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.summary-back-link {
    font-size: 12px;
    color: var(--gray-400);
    text-align: center;
    margin-top: 10px;
    display: block;
}

.summary-back-link a {
    color: var(--primary-light);
}

.summary-back-link a:hover {
    color: var(--accent);
}

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

@media (max-width: 1023px) {
    .chores-layout {
        grid-template-columns: 1fr;
    }

    .chores-summary-wrap {
        position: static;
    }

    .chores-summary {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        z-index: 800;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
        max-height: 80vh;
        overflow-y: auto;
    }

    .chores-summary:not(.open) .summary-body {
        display: none;
    }

    .summary-header {
        cursor: pointer;
    }

    .drawer-arrow {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.7);
    }

    /* Bottom padding so content isn't hidden behind fixed drawer */
    .chores-section {
        padding-bottom: 80px;
    }
}

@media (max-width: 768px) {
    .chore-cards-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .chore-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   DARK MODE OVERRIDES
   ========================================== */

html[data-theme="dark"] .mini-calc {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .mini-calc__header {
    background: rgba(59, 130, 246, 0.08);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .mc-prop-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

html[data-theme="dark"] .mc-input,
html[data-theme="dark"] .mc-select {
    background: #0a0e1a;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .mc-addon-check {
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

html[data-theme="dark"] .mini-calc__result {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* Chores summary: restore dark surface in dark mode */
html[data-theme="dark"] .chores-summary {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .chores-empty { color: rgba(255,255,255,0.45); }
html[data-theme="dark"] .chores-selected-item { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.06); }
html[data-theme="dark"] .summary-divider { background: rgba(255,255,255,0.1); }
html[data-theme="dark"] .summary-line { color: rgba(255,255,255,0.6); }
html[data-theme="dark"] .summary-line.total { color: var(--white); }
html[data-theme="dark"] .summary-line .amount { color: rgba(255,255,255,0.85); }
html[data-theme="dark"] .summary-min-note { color: rgba(255,255,255,0.55); }
html[data-theme="dark"] .summary-back-link { color: rgba(255,255,255,0.5); }

html[data-theme="dark"] .chore-card {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .chore-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

html[data-theme="dark"] .chore-card.selected {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary-light);
}

html[data-theme="dark"] .chores-info-note {
    background: var(--surface-light);
    border-color: rgba(255, 255, 255, 0.06);
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .mini-calc__body {
        transition: none;
    }

    .chore-card {
        transition: none;
    }

    .chore-card:hover {
        transform: none;
    }

    .mc-prop-btn,
    .mc-counter-btn,
    .mc-addon-check,
    .mc-input,
    .mc-select,
    .chore-check {
        transition: none;
    }
}


/* ========================================
   Qty Controls for tiered chores
   ======================================== */
.chore-card-qty { display: flex; flex-direction: column; padding: 0 !important; cursor: default; overflow: hidden; }
.chore-card-qty .chore-card-inner {
    display: block;
    position: relative;
    padding: 18px 16px;
    cursor: pointer;
    border-radius: var(--radius, 16px);
}
.chore-qty-wrap {
    display: none;
    padding: 12px 18px 16px;
    border-top: 1px dashed rgba(30, 64, 175, 0.15);
    background: rgba(30, 64, 175, 0.04);
    border-radius: 0 0 16px 16px;
    flex-direction: column;
    gap: 8px;
}
.chore-card-qty .chore-qty-wrap.is-open { display: flex; }
.chore-qty-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}
.chore-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chore-qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.chore-qty-btn:hover { background: var(--primary); color: #fff; }
.chore-qty-input {
    width: 80px;
    height: 34px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid rgba(30, 64, 175, 0.25);
    font-weight: 700;
    font-size: 15px;
    color: var(--dark);
    background: #fff;
}
.chore-qty-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ========================================
   Grouped Order Summary
   ======================================== */
.chores-group-header {
    list-style: none;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--primary);
    margin: 14px 0 4px;
    padding: 0 0 4px;
    border-bottom: 1px solid rgba(30, 64, 175, 0.14);
}
.chores-group-header:first-child { margin-top: 0; }
.chores-item-qty {
    font-size: 11px;
    color: var(--muted, #64748b);
    font-weight: 500;
    margin-left: 4px;
}
.chores-item-name {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px;
}
/* Mini-calc tiered addon qty controls */
.mc-addon-wrap { display: flex; flex-direction: column; gap: 6px; }
.mc-addon-desc {
    margin-left: 26px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(30, 64, 175, 0.05));
    border-left: 3px solid var(--accent, #f59e0b);
    border-radius: 6px;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.45;
    animation: mcAddonDescIn 0.25s ease;
}
.mc-addon-desc[hidden] { display: none; }
@keyframes mcAddonDescIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.mc-addon-qty-wrap {
    margin-left: 26px;
    padding: 8px 10px;
    border-left: 2px solid var(--primary, #1E40AF);
    background: rgba(30, 64, 175, 0.04);
    border-radius: 6px;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mc-addon-qty-label { font-size: 12px; font-weight: 600; color: var(--primary, #1E40AF); }
.mc-addon-qty-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mc-addon-qty-btn {
    width: 28px; height: 28px; border-radius: 6px;
    border: 1px solid var(--primary, #1E40AF); background: #fff;
    color: var(--primary, #1E40AF); font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
}
.mc-addon-qty-btn:hover { background: var(--primary, #1E40AF); color: #fff; }
.mc-addon-qty-input {
    width: 60px; height: 28px; text-align: center; border-radius: 6px;
    border: 1px solid rgba(30, 64, 175, 0.25); font-weight: 700; font-size: 13px;
}
.mc-addon-qty-price { font-weight: 700; color: var(--primary, #1E40AF); font-size: 13px; margin-left: 4px; }
/* Tier pricing chips (chores page + mini-calc addon) */
.chore-tier-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.chore-tier-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(30,64,175,0.08), rgba(30,64,175,0.03));
    border: 1px solid rgba(30,64,175,0.18);
    font-size: 12px;
    font-weight: 600;
    color: var(--dark, #0f172a);
    line-height: 1;
    white-space: nowrap;
}
.chore-tier-chip .tier-range {
    color: var(--muted, #64748b);
    font-weight: 700;
    letter-spacing: 0.02em;
}
.chore-tier-chip .tier-sep {
    color: rgba(30,64,175,0.35);
    font-weight: 700;
}
.chore-tier-chip .tier-price {
    color: var(--primary, #1E40AF);
    font-weight: 800;
}
.chore-tier-chip .tier-price small {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted, #64748b);
    margin-left: 1px;
}
/* Mini-calc: chips sit on their own row inside qty-wrap */
.mc-addon-tier-chips { margin: 0 0 6px 0; }
.mc-addon-qty-wrap { flex-direction: column; align-items: flex-start; }
