/*
 * MORPHEUTIC - Dark Mode Fixes (darkfix.css)
 * Loaded after theme.css. Fixes elements not covered by base theme.
 * Only active when data-bs-theme="dark" is set.
 */

/* == 1. Global == */
[data-bs-theme="dark"] { color-scheme: dark; }
[data-bs-theme="dark"] .bg-white { background-color: #1F261D !important; }
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-body-tertiary { background-color: #243222 !important; }
[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-black { color: #e8e8e8 !important; }
[data-bs-theme="dark"] .text-muted { color: #8a9e8a !important; }
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top { border-color: #3a4e38 !important; }

/* == 2. Cards == */
[data-bs-theme="dark"] .card:not(.bg-transparent) {
    background-color: #243222;
    border-color: #3a4e38;
}
[data-bs-theme="dark"] .card-body { color: #c8d8c8; }

/* == 3. Product card buttons (class-based) == */
.mph-card-atc-btn {
    background: #fff;
    color: #222;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 10px;
    cursor: pointer;
    transition: all 0.3s;
}
.mph-card-wl-btn {
    background: #fff;
    color: #e91e63;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    padding: 9px 13px;
    cursor: pointer;
    transition: all 0.3s;
}
[data-bs-theme="dark"] .mph-card-atc-btn {
    background: #2a3828 !important;
    color: #d4e8d4 !important;
    border: 1px solid #3a5a3a !important;
}
[data-bs-theme="dark"] .mph-card-atc-btn:hover { background: #344e34 !important; }
[data-bs-theme="dark"] .mph-card-wl-btn {
    background: #2a1f2a !important;
    color: #f48fb1 !important;
    border: 1px solid #5a3a5a !important;
}
[data-bs-theme="dark"] .mph-card-wl-btn:hover { background: #382838 !important; }

/* Inline style overrides for any remaining hardcoded #fff buttons */
[data-bs-theme="dark"] button[style*="background:#fff"] {
    background: #2a3828 !important;
    color: #d4e8d4 !important;
}
[data-bs-theme="dark"] button[style*="background:#999"] {
    background: #3a3a3a !important;
    color: #aaa !important;
}

/* == 4. Forms & Inputs == */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] input[type="text"],
[data-bs-theme="dark"] input[type="email"],
[data-bs-theme="dark"] input[type="tel"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] input[type="password"],
[data-bs-theme="dark"] textarea {
    background-color: #1a2418;
    color: #dde8dd;
    border-color: #3a4e38;
}
[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] input::placeholder { color: #6a7e6a; }
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] input:focus,
[data-bs-theme="dark"] textarea:focus {
    background-color: #1e2d1c;
    border-color: #4a8a4a;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(74,138,74,0.18);
}
[data-bs-theme="dark"] label { color: #b0c4b0; }
[data-bs-theme="dark"] .input-group-text {
    background-color: #243222;
    border-color: #3a4e38;
    color: #b0c4b0;
}

/* == 5. Buttons == */
[data-bs-theme="dark"] .btn-outline-secondary {
    color: #9ab89a;
    border-color: #3a4e38;
}
[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background: #2a3828;
    color: #dde8dd;
}
[data-bs-theme="dark"] .btn-light {
    background: #2a3828;
    border-color: #3a4e38;
    color: #dde8dd;
}
[data-bs-theme="dark"] .btn-dark {
    background: #e0e8e0;
    color: #1a2418;
    border-color: #c0d0c0;
}
[data-bs-theme="dark"] .btn-dark:hover { background: #fff; color: #111; }

/* == 6. Navigation & Header == */
[data-bs-theme="dark"] .main-header,
[data-bs-theme="dark"] .navbar { border-bottom-color: #3a4e38 !important; }
[data-bs-theme="dark"] .offcanvas { background-color: #1a2418 !important; }
[data-bs-theme="dark"] .offcanvas-header,
[data-bs-theme="dark"] .offcanvas-footer {
    background-color: #141e12 !important;
    border-color: #3a4e38 !important;
}
[data-bs-theme="dark"] .nav-link { color: #b0c4b0; }
[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link.active { color: #fff; }

/* == 7. Dropdowns == */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e2d1c;
    border-color: #3a4e38;
    box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
[data-bs-theme="dark"] .dropdown-item { color: #c8d8c8; }
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #2a3828;
    color: #fff;
}
[data-bs-theme="dark"] .dropdown-divider { border-color: #3a4e38; }

/* == 8. Tabs == */
[data-bs-theme="dark"] .nav-tabs { border-bottom-color: #3a4e38; }
[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #8a9e8a;
    border-color: transparent;
}
[data-bs-theme="dark"] .nav-tabs .nav-link:hover { color: #c8d8c8; }
[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background-color: #243222;
    border-color: #3a4e38 #3a4e38 #243222;
    color: #fff;
}
[data-bs-theme="dark"] .tab-pane { color: #c8d8c8; }

/* == 9. Modals == */
[data-bs-theme="dark"] .modal-content {
    background-color: #1e2d1c;
    border-color: #3a4e38;
}
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer { border-color: #3a4e38; }
[data-bs-theme="dark"] .modal-title { color: #fff; }

/* == 10. Sticky Add to Cart bar == */
[data-bs-theme="dark"] #sticky-atc-bar {
    background: #1a2418 !important;
    border-top: 1px solid #3a4e38;
    box-shadow: 0 -3px 16px rgba(0,0,0,0.5);
}
[data-bs-theme="dark"] .sticky-price-text { color: #e8e8e8 !important; }
[data-bs-theme="dark"] .sticky-prod-name  { color: #a0b8a0 !important; }

/* == 11. Accordion (product details) == */
[data-bs-theme="dark"] .accordion-item {
    background-color: #1e2d1c;
    border-color: #3a4e38;
}
[data-bs-theme="dark"] .accordion-button {
    background-color: #1e2d1c;
    color: #dde8dd;
}
[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #243222;
    color: #fff;
    box-shadow: inset 0 -1px 0 #3a4e38;
}
[data-bs-theme="dark"] .accordion-body { color: #b0c4b0; }

/* == 12. Checkout page == */
[data-bs-theme="dark"] .saved-addr-card {
    background: #1e2d1c !important;
    border-color: #3a4e38 !important;
    color: #c8d8c8;
}
[data-bs-theme="dark"] .saved-addr-card.selected {
    border-color: #4a8a4a !important;
    background: #243222 !important;
}
[data-bs-theme="dark"] #pay-online-card,
[data-bs-theme="dark"] #pay-cod-card {
    background: #1e2d1c;
    border-color: #3a4e38;
    color: #c8d8c8;
}
[data-bs-theme="dark"] #pay-online-card.selected,
[data-bs-theme="dark"] #pay-cod-card.selected {
    border-color: #4a8a4a;
    background: #243222;
}
[data-bs-theme="dark"] #checkout-form label { color: #b0c4b0; }

/* == 13. Coupon section == */
[data-bs-theme="dark"] .mph-coupon-header { color: #8ab88a; }
[data-bs-theme="dark"] .mph-coupon-card {
    background: #1a2e1a;
    border-color: #3a7a3a;
}
[data-bs-theme="dark"] .mph-coupon-card:hover { background: #1f361f; }
[data-bs-theme="dark"] .mph-coupon-card.applied {
    background: #1f361f;
    border-color: #4a8a4a;
}
[data-bs-theme="dark"] .mph-coupon-input {
    background: #1a2418 !important;
    border-color: #3a4e38 !important;
    color: #dde8dd !important;
}
[data-bs-theme="dark"] .mph-coupon-btn { background: #2a5a2a; }
[data-bs-theme="dark"] .mph-coupon-btn:hover { background: #3a6a3a; }
[data-bs-theme="dark"] .mph-discount-row { border-top-color: #3a6a3a; }

/* == 14. WhatsApp popup == */
[data-bs-theme="dark"] .wa-popup {
    background: #1e2d1c;
    border-color: #3a4e38;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
[data-bs-theme="dark"] .wa-popup-text b { color: #dde8dd; }
[data-bs-theme="dark"] .wa-popup-text span { color: #7a9a7a; }
[data-bs-theme="dark"] .wa-close-btn {
    background: #243222;
    border-color: #3a4e38;
    color: #8a9e8a;
}
[data-bs-theme="dark"] .wa-close-btn:hover {
    background: #2a3828;
    color: #dde8dd;
}

/* == 15. Tables (cart) == */
[data-bs-theme="dark"] .table {
    color: #c8d8c8;
    border-color: #3a4e38;
}
[data-bs-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    border-color: #3a4e38;
    color: #c8d8c8;
}

/* == 16. Alerts == */
[data-bs-theme="dark"] .alert-success {
    background-color: #1a3020;
    border-color: #2a5030;
    color: #8ad4a0;
}
[data-bs-theme="dark"] .alert-danger {
    background-color: #2d1a1a;
    border-color: #4a2020;
    color: #f48888;
}
[data-bs-theme="dark"] .alert-warning {
    background-color: #2a2010;
    border-color: #4a3818;
    color: #e8c060;
}

/* == 17. List groups == */
[data-bs-theme="dark"] .list-group-item {
    background-color: #1e2d1c;
    border-color: #3a4e38;
    color: #c8d8c8;
}
[data-bs-theme="dark"] .list-group-item.active {
    background-color: #2a4a2a;
    border-color: #4a8a4a;
}

/* == 18. Breadcrumbs == */
[data-bs-theme="dark"] .breadcrumb-item { color: #8a9e8a; }
[data-bs-theme="dark"] .breadcrumb-item.active { color: #dde8dd; }
[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: #5a6e5a; }

/* == 19. Pagination == */
[data-bs-theme="dark"] .page-link {
    background-color: #1e2d1c;
    border-color: #3a4e38;
    color: #8ab88a;
}
[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: #2a5a2a;
    border-color: #4a8a4a;
    color: #fff;
}

/* == 20. Inline style background overrides == */
[data-bs-theme="dark"] [style*="background:#f9f9f9"],
[data-bs-theme="dark"] [style*="background: #f9f9f9"],
[data-bs-theme="dark"] [style*="background:#f4f4f4"],
[data-bs-theme="dark"] [style*="background:#fafafa"],
[data-bs-theme="dark"] [style*="background-color:#fff"],
[data-bs-theme="dark"] [style*="background-color: #fff"] {
    background-color: #243222 !important;
}
[data-bs-theme="dark"] [style*="color:#333"],
[data-bs-theme="dark"] [style*="color: #333"],
[data-bs-theme="dark"] [style*="color:#111"],
[data-bs-theme="dark"] [style*="color:#000"] {
    color: #dde8dd !important;
}
[data-bs-theme="dark"] [style*="color:#666"],
[data-bs-theme="dark"] [style*="color:#999"],
[data-bs-theme="dark"] [style*="color:#888"],
[data-bs-theme="dark"] [style*="color:#555"] {
    color: #8a9e8a !important;
}

/* == 21. Section backgrounds == */
[data-bs-theme="dark"] section.bg-white,
[data-bs-theme="dark"] section.bg-light {
    background-color: #1F261D !important;
}
[data-bs-theme="dark"] .mobile-promo-line {
    background: linear-gradient(135deg, #1a3828, #243222) !important;
}

/* == 22. Scrollbar == */
[data-bs-theme="dark"] ::-webkit-scrollbar { width: 6px; }
[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: #1a2418; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3a5a3a;
    border-radius: 3px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4a7a4a; }
