:root {
    --mdrx-navy: #152749;
    --mdrx-navy-dark: #0b1830;
    --mdrx-red: #c91322;
    --mdrx-red-dark: #9f111c;
    --mdrx-teal: #168ca8;
    --mdrx-teal-dark: #0d7089;

    --mdrx-white: #ffffff;
    --mdrx-bg: #f5f7fa;
    --mdrx-soft: #eef3f7;
    --mdrx-border: #d8e1ea;
    --mdrx-text: #152749;
    --mdrx-muted: #64748b;

    /* Legacy component compatibility */
    --cp-primary: var(--mdrx-navy);
    --cp-primary-dark: var(--mdrx-navy-dark);
    --cp-secondary: var(--mdrx-red);
    --cp11-primary: var(--mdrx-navy);
    --cp11-primary-dark: var(--mdrx-navy-dark);
    --cp11-text: var(--mdrx-text);
    --cp11-muted: var(--mdrx-muted);
    --cp11-line: var(--mdrx-border);
}

/* =========================================================
   Global storefront
   ========================================================= */

html,
body {
    background: var(--mdrx-bg) !important;
    color: var(--mdrx-text) !important;
}

a {
    color: var(--mdrx-navy);
}

a:hover {
    color: var(--mdrx-red);
}

/* =========================================================
   Top information bar
   ========================================================= */

body .cp11-topbar {
    background: var(--mdrx-navy-dark) !important;
    color: var(--mdrx-white) !important;
    border: 0 !important;
}

body .cp11-topbar__inner {
    min-height: 52px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
}

body .cp11-topbar__contact,
body .cp11-topbar__links {
    display: flex !important;
    align-items: center !important;
    gap: 22px !important;
}

body .cp11-topbar__contact a,
body .cp11-topbar__links a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

body .cp11-topbar__contact a:hover,
body .cp11-topbar__links a:hover {
    color: #dceaf3 !important;
}

body .cp11-topbar .cp-head-ico {
    width: 31px !important;
    height: 31px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.12) !important;
    color: #ffffff !important;
    font-size: 14px !important;
}

/* =========================================================
   Main header
   ========================================================= */

body .cp11-header,
body .cp11-header__main {
    background: #ffffff !important;
}

body .cp11-header {
    border-bottom: 1px solid var(--mdrx-border) !important;
    box-shadow: 0 8px 26px rgba(21,39,73,.07) !important;
}

body .cp11-logo {
    background: transparent !important;
}

body .cp11-logo img {
    width: auto !important;
    max-width: 190px !important;
    max-height: 72px !important;
    object-fit: contain !important;
}

/* =========================================================
   Search
   ========================================================= */

body .cp11-search {
    background: #ffffff !important;
    border: 1px solid #cbd7e2 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

body .cp11-search:focus-within {
    border-color: var(--mdrx-teal) !important;
    box-shadow: 0 0 0 4px rgba(22,140,168,.12) !important;
}

body .cp11-search input {
    background: #ffffff !important;
    color: var(--mdrx-text) !important;
}

body .cp11-search input::placeholder {
    color: #788597 !important;
}

body .cp11-search select {
    background: #ffffff !important;
    color: var(--mdrx-text) !important;
    border-left: 1px solid var(--mdrx-border) !important;
}

body .cp11-search button {
    background: var(--mdrx-teal) !important;
    color: #ffffff !important;
    border: 0 !important;
}

body .cp11-search button:hover {
    background: var(--mdrx-teal-dark) !important;
}

/* =========================================================
   Header account, wishlist and cart
   ========================================================= */

body .cp11-action,
body .cp11-action small {
    color: var(--mdrx-navy) !important;
    font-weight: 750 !important;
}

body .cp11-action span {
    color: var(--mdrx-navy) !important;
}

body .cp11-icon-action {
    background: #ffffff !important;
    border: 1px solid var(--mdrx-border) !important;
    color: var(--mdrx-navy) !important;
}

body .cp11-icon-action:hover {
    background: var(--mdrx-soft) !important;
    border-color: var(--mdrx-teal) !important;
    color: var(--mdrx-teal) !important;
}

body .cp11-icon-action strong {
    background: var(--mdrx-red) !important;
    color: #ffffff !important;
}

body .cp11-cart-btn {
    background: var(--mdrx-red) !important;
    border-color: var(--mdrx-red) !important;
    color: #ffffff !important;
}

body .cp11-cart-btn:hover {
    background: var(--mdrx-red-dark) !important;
    border-color: var(--mdrx-red-dark) !important;
}

/* =========================================================
   Main navigation
   ========================================================= */

body .cp11-nav-wrap,
body .cp11-nav,
body .cp11-nav__grid {
    background: var(--mdrx-navy) !important;
}

body .cp11-allcat {
    background: var(--mdrx-red) !important;
    border: 0 !important;
    color: #ffffff !important;
}

body .cp11-allcat:hover,
body .cp11-allcat[aria-expanded="true"] {
    background: var(--mdrx-red-dark) !important;
}

body .cp11-allcat,
body .cp11-allcat span,
body .cp11-allcat svg {
    color: #ffffff !important;
    stroke: currentColor !important;
}

body .cp11-nav a,
body .cp11-nav__grid > a {
    background: transparent !important;
    color: #ffffff !important;
    font-weight: 750 !important;
}

body .cp11-nav a span,
body .cp11-nav a svg,
body .cp11-nav__grid > a span,
body .cp11-nav__grid > a svg {
    color: #ffffff !important;
    stroke: currentColor !important;
}

body .cp11-nav a:hover,
body .cp11-nav__grid > a:hover,
body .cp11-nav a.active {
    background: rgba(255,255,255,.09) !important;
    color: #ffffff !important;
}

body .cp11-nav a::after {
    background: var(--mdrx-red) !important;
}

/* =========================================================
   Mega menu
   ========================================================= */

body .cp11-mega-menu {
    background: #ffffff !important;
    border: 1px solid var(--mdrx-border) !important;
    box-shadow: 0 20px 48px rgba(21,39,73,.15) !important;
}

body .cp11-mega-menu__head {
    background: var(--mdrx-soft) !important;
    color: var(--mdrx-navy) !important;
    border-bottom: 1px solid var(--mdrx-border) !important;
}

body .cp11-mega-menu__title {
    color: var(--mdrx-navy) !important;
}

body .cp11-mega-menu__title:hover,
body .cp11-mega-menu__col a:hover {
    color: var(--mdrx-red) !important;
}

/* =========================================================
   Buttons
   ========================================================= */

body .btn-primary,
body .cp-btn-primary,
body .cp11-add-cart,
body .cp-add-cart,
body button[type="submit"] {
    background: var(--mdrx-navy) !important;
    border-color: var(--mdrx-navy) !important;
    color: #ffffff !important;
}

body .btn-primary:hover,
body .cp-btn-primary:hover,
body .cp11-add-cart:hover,
body .cp-add-cart:hover,
body button[type="submit"]:hover {
    background: var(--mdrx-navy-dark) !important;
    border-color: var(--mdrx-navy-dark) !important;
}

/* =========================================================
   Products and cards
   ========================================================= */

body .card,
body .cp-card,
body .cp11-product-card {
    background: #ffffff !important;
    border-color: var(--mdrx-border) !important;
    box-shadow: 0 10px 28px rgba(21,39,73,.08) !important;
}

body .cp11-product-card:hover {
    box-shadow: 0 18px 42px rgba(21,39,73,.13) !important;
}

body .cp11-product-card__image {
    background: linear-gradient(180deg, #ffffff, #f3f6f9) !important;
}

body .cp11-price-row strong,
body .cp-price,
body .product-price {
    color: var(--mdrx-red) !important;
}

body .cp11-discount,
body .sale-badge,
body .discount-badge {
    background: var(--mdrx-red) !important;
    color: #ffffff !important;
}

/* =========================================================
   Forms
   ========================================================= */

body input:focus,
body select:focus,
body textarea:focus {
    border-color: var(--mdrx-teal) !important;
    box-shadow: 0 0 0 4px rgba(22,140,168,.12) !important;
}

/* =========================================================
   Footer
   ========================================================= */

body .cp11-footer,
body .cp-footer,
body .site-footer,
body footer {
    background: var(--mdrx-navy-dark) !important;
    color: #dce3eb !important;
}

body .cp11-footer h1,
body .cp11-footer h2,
body .cp11-footer h3,
body .cp11-footer h4,
body .cp11-footer h5,
body .cp-footer h1,
body .cp-footer h2,
body .cp-footer h3,
body .cp-footer h4,
body .cp-footer h5 {
    color: #ffffff !important;
}

body .cp11-footer a,
body .cp-footer a,
body .site-footer a {
    color: #dce3eb !important;
}

body .cp11-footer a:hover,
body .cp-footer a:hover,
body .site-footer a:hover {
    color: #ffffff !important;
}

/* =========================================================
   Mobile
   ========================================================= */

body .cp11-mobile-menu-btn {
    background: var(--mdrx-navy) !important;
    color: #ffffff !important;
    border: 0 !important;
}

body .cp11-mobile-search-row {
    background: #ffffff !important;
}

@media (max-width: 767px) {
    body .cp11-topbar__inner {
        min-height: auto !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    body .cp11-topbar__contact,
    body .cp11-topbar__links {
        width: 100% !important;
        justify-content: space-between !important;
        gap: 10px !important;
        overflow-x: auto !important;
    }

    body .cp11-topbar__contact a,
    body .cp11-topbar__links a {
        font-size: 12px !important;
    }

    body .cp11-logo img {
        max-width: 132px !important;
        max-height: 50px !important;
    }
}

/* MDRx topbar definitive layout */
body .cp11-topbar__inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 52px !important;
}

body .cp11-topbar__contact {
    display: flex !important;
    align-items: center !important;
    gap: 22px !important;
    margin-right: auto !important;
}

body .cp11-topbar__links {
    display: flex !important;
    align-items: center !important;
    gap: 22px !important;
    margin-left: auto !important;
}

body .cp11-topbar__contact a,
body .cp11-topbar__links a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700 !important;
}

/* MDRx medical category cards */
.cp11-mega-menu__title > span,
.cp-category-icon,
.cp11-category-icon,
.cp-category-card__icon {
    background: #eef3f7 !important;
    color: #152749 !important;
    border: 1px solid #d8e1ea !important;
}

.cp11-mega-menu__title:hover > span,
.cp-category-card:hover .cp-category-icon,
.cp-category-card:hover .cp11-category-icon {
    background: #152749 !important;
    color: #ffffff !important;
    border-color: #152749 !important;
}

.cp11-mega-menu__col {
    background: #ffffff !important;
    border: 1px solid #d8e1ea !important;
    border-radius: 16px !important;
}

.cp11-mega-menu__col:hover {
    border-color: #168ca8 !important;
    box-shadow: 0 10px 24px rgba(21,39,73,.08) !important;
}

.cp11-mega-menu__col a {
    color: #475569 !important;
}

.cp11-mega-menu__title {
    color: #152749 !important;
}

.cp11-mega-menu__title:hover,
.cp11-mega-menu__col a:hover {
    color: #c91322 !important;
}

/* MDRx mobile header logo visibility */
.cp11-logo picture,
.cp11-logo .cp11-logo-picture {
    display: block !important;
    width: 100% !important;
}

.cp11-logo picture img,
.cp11-logo .cp11-logo-picture img {
    display: block !important;
    width: auto !important;
    max-width: 190px !important;
    max-height: 72px !important;
    object-fit: contain !important;
}

@media (max-width: 767px) {
    .cp11-logo {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .cp11-logo picture,
    .cp11-logo .cp11-logo-picture {
        display: block !important;
        width: auto !important;
        max-width: 132px !important;
    }

    .cp11-logo picture img,
    .cp11-logo .cp11-logo-picture img {
        display: block !important;
        width: auto !important;
        max-width: 132px !important;
        max-height: 48px !important;
        object-fit: contain !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* =========================================================
   MDRx Footer Final Design
   ========================================================= */

body .cp11-footer,
body .cp11-footer--premium,
body .cp11-footer--luxury {
    background: #0b1830 !important;
    color: #ffffff !important;
    border-top: 0 !important;
}

body .cp11-footer__grid,
body .cp11-footer__grid--luxury {
    background: #0b1830 !important;
}

body .cp11-footer h3,
body .cp11-footer h4,
body .cp11-footer strong,
body .cp11-footer__block h4 {
    color: #ffffff !important;
}

body .cp11-footer p,
body .cp11-footer small,
body .cp11-footer span,
body .cp11-footer__block a,
body .cp11-footer__block small,
body .cp11-footer-contact-mini a,
body .cp11-footer-contact-mini span {
    color: #cbd5e1 !important;
}

body .cp11-footer a:hover {
    color: #ffffff !important;
}

body .cp11-footer__block h4::after {
    background: #168ca8 !important;
}

body .cp11-footer-logo,
body .cp11-footer__brand {
    color: #ffffff !important;
}

body .cp11-footer-logo img {
    display: block !important;
    max-width: 190px !important;
    max-height: 70px !important;
    object-fit: contain !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    padding: 8px !important;
}

body .cp11-socials a,
body .cp11-footer-social a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #152749 !important;
    border: 1px solid rgba(255,255,255,.18) !important;
}

body .cp11-socials a:hover,
body .cp11-footer-social a:hover {
    background: #c91322 !important;
    color: #ffffff !important;
}

body .cp11-footer__bottom {
    background: #152749 !important;
    color: #ffffff !important;
    border-top: 1px solid rgba(255,255,255,.12) !important;
}

body .cp11-footer__bottom span,
body .cp11-footer__bottom a,
body .cp11-footer__bottom strong {
    color: #ffffff !important;
}

body .cp11-footer__payments {
    color: #ffffff !important;
}

body .cp11-footer-contact-mini strong {
    color: #ffffff !important;
}

@media (max-width: 767px) {
    body .cp11-footer__grid,
    body .cp11-footer__grid--luxury {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    body .cp11-footer-logo img {
        max-width: 165px !important;
    }
}

/* MDRx footer text contrast refinement */
body .cp11-footer,
body .cp11-footer--premium,
body .cp11-footer--luxury {
    color: #ffffff !important;
}

body .cp11-footer h3,
body .cp11-footer h4,
body .cp11-footer__block h4,
body .cp11-footer-contact-mini strong {
    color: #ffffff !important;
    opacity: 1 !important;
}

body .cp11-footer p,
body .cp11-footer__brand p {
    color: #dbe4ee !important;
    opacity: 1 !important;
}

body .cp11-footer__block a,
body .cp11-footer__block small,
body .cp11-footer-contact-mini a,
body .cp11-footer-contact-mini span,
body .cp11-footer small {
    color: #c7d2df !important;
    opacity: 1 !important;
}

body .cp11-footer__block a:hover,
body .cp11-footer-contact-mini a:hover {
    color: #ffffff !important;
}

body .cp11-footer__bottom,
body .cp11-footer__bottom span,
body .cp11-footer__bottom a,
body .cp11-footer__bottom strong {
    color: #ffffff !important;
    opacity: 1 !important;
}

body .cp11-footer__bottom {
    background: #14294b !important;
}

body .cp11-footer__block h4::after {
    background: #18a0bd !important;
}

/* MDRx footer section titles — final contrast fix */
body .cp11-footer .cp11-footer__block > h4,
body .cp11-footer .cp11-footer__block h4,
body .cp11-footer .cp11-footer-contact-mini > h4,
body .cp11-footer .cp11-footer-contact-mini h4,
body .cp11-footer h4,
body .cp11-footer h3 {
    color: #FFFFFF !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #FFFFFF !important;
    text-shadow: none !important;
}

body .cp11-footer .cp11-footer__block > h4::after,
body .cp11-footer .cp11-footer__block h4::after,
body .cp11-footer .cp11-footer-contact-mini > h4::after {
    background: #20A9C3 !important;
    opacity: 1 !important;
}

/* MDRx footer contact block contrast fix */
body .cp11-footer .cp11-footer-contact-mini strong,
body .cp11-footer .cp11-footer-contact-mini b,
body .cp11-footer .cp11-footer-contact-mini .label,
body .cp11-footer .cp11-footer-contact-mini [class*="label"] {
    color: #FFFFFF !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

body .cp11-footer .cp11-footer-contact-mini a,
body .cp11-footer .cp11-footer-contact-mini span,
body .cp11-footer .cp11-footer-contact-mini p,
body .cp11-footer .cp11-footer-contact-mini small,
body .cp11-footer .cp11-footer-contact-mini [class*="value"] {
    color: #D9E3EE !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #D9E3EE !important;
}

body .cp11-footer .cp11-footer-contact-mini a:hover {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

body .cp11-footer .cp11-footer-contact-mini svg,
body .cp11-footer .cp11-footer-contact-mini i {
    color: #20A9C3 !important;
    fill: currentColor !important;
    opacity: 1 !important;
}

/* MDRx footer contact details — exact selectors */
body .cp11-footer .cp-contact-list,
body .cp11-footer .cp-contact-item {
    color: #ffffff !important;
}

body .cp11-footer .cp-contact-item strong {
    display: block !important;
    margin-bottom: 3px !important;
    color: #ffffff !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 800 !important;
}

body .cp11-footer .cp-contact-item a,
body .cp11-footer .cp-contact-item span {
    display: block !important;
    color: #d7e1ec !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #d7e1ec !important;
    text-decoration: none !important;
}

body .cp11-footer .cp-contact-item a:hover {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

body .cp11-footer .cp-contact-icon {
    background: rgba(22, 140, 168, 0.18) !important;
    color: #28b4cf !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #28b4cf !important;
    border: 1px solid rgba(40, 180, 207, 0.24) !important;
}

body .cp11-footer .cp-contact-item > div:last-child {
    color: #ffffff !important;
    opacity: 1 !important;
}
