:root {
     /* Dallas College brand colors */
    --dc-brand-blue: rgba(0, 51, 133, 1);
    --dc-brand-lightblue: rgba(235, 240, 253, 1);
    --dc-brand-red: rgba(229, 38, 38, 1);
    --dc-brand-mediumred: rgba(204, 41, 41, 1);
    --dc-brand-darkred: rgba(100, 15, 9, 1);
    --dc-brand-darkgray: rgba(53, 59, 60, 1);

    /* dxp styling hook overrides */
    --dxp-g-brand: var(--dc-brand-blue);
    --dxp-g-brand-contrast: #fff;
    --dxp-g-root: #fff;
    --dxp-g-root-contrast: #000;
    --dxp-s-button-color: var(--dc-brand-mediumred);
    --dxp-s-button-color-contrast: #fff;
    --dxp-s-tertiary-button-text-color: var(--dc-brand-mediumred);
}

/* Items intended only for screen reader users, taken from https://webaim.org/techniques/css/invisiblecontent/ */
.sr-only {
    position:absolute;
    left:-10000px;
    top:auto;
    width:1px;
    height:1px;
    overflow:hidden;
}

.text-black {
    color: #000;
}

.slds-button_icon.slds-panel__close {
    color: var(--dxp-g-neutral);
}

.custom-header {
    .input-search-button:hover,
    .input-search-button:focus-visible,
    .menu-button:hover,
    .menu-button:focus-visible,
    .login-link:hover,
    .login-link:focus-visible,
    .wishlist-shortcut-wrapper a:hover,
    .wishlist-shortcut-wrapper a:focus-visible,
    .cart-container button:hover,
    .cart-container button:focus-visible {
        outline: 1px solid var(--dc-brand-lightblue) !important;
        background-color: var(--dxp-g-root-1) !important; /* overriding some inline styles set by builder that don't allow for hover/focus state */
    }

    .header-account,
    .header-wishlist,
    .header-cart {
        height: 2rem;
        width: 2rem;

        .menu-button,
        .login-link,
        commerce-wishlist-shortcut a,
        .cart-container button {
            height: 2rem;
            width: 2rem;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 0;
        }
    }

    .header-account,
    .header-wishlist {
        margin-right: 0.5rem;
    }

    .login-link .login-text {
        display: none;
    }

    .wishlist-shortcut-wrapper commerce-wishlist-shortcut,
    commerce_cart-badge {
        padding: 0;
    }
}

.custom-profile-menu {
    .dropdown-ctn {
        background-color: var(--dxp-g-root-contrast) !important;
    }

    a.profile-menu-item {
        background-color: var(--dxp-g-root-contrast) !important;
    }

    .slds-dropdown__list a.menu-item-bg-hover-color {
        background-color: var(--dxp-g-root-contrast) !important;
    }

    .slds-dropdown__list a.menu-item {
        color: var(--dxp-g-root-1) !important;
    }

    .slds-dropdown__list a.menu-item_hover {
        color: var(--dxp-g-root-1) !important;
    }
}

/* Mini-Cart - need to override a lot since the Header color palette doesn't cascade down nicely */
.custom-mini-cart {
    --dxp-s-text-heading-large-color: var(--dc-brand-red);

    .description-name-label .dxp-text-body {
        --dxp-c-text-block-text-color: var(--dc-brand-darkgray);
        --dxp-c-l-text-block-font-weight: 700;
    }

    .actualPrice {
        --com-c-cart-item-actual-price-font-color: var(--dc-brand-darkgray);
    }

    .item-details-pills-qty .new-line {
        --com-c-variant-attribute-color: var(--dc-brand-darkgray);
    }

    commerce-quantity-selector * {
        display: none;
    }

    .slds-panel .panel_footer {
        background: var(--dxp-g-root-contrast);
    }

    commerce-action-button {
        --com-c-button-primary-color-background: var(--dc-brand-red);
        --com-c-button-primary-color-background-hover: var(--dc-brand-mediumred);
        --com-c-button-primary-color-background-focus: var(--dc-brand-mediumred);
        --com-c-button-primary-color-background-active: var(--dc-brand-mediumred);
        --com-c-action-button-secondary-color: var(--dc-brand-red);
        --com-c-action-button-secondary-color-hover: var(--dc-brand-red);
        --com-c-action-button-secondary-color-focus: var(--dc-brand-red);
        --com-c-action-button-secondary-color-active: var(--dc-brand-red);
        --com-c-button-secondary-color-border: var(--dc-brand-red);
        --com-c-button-secondary-color-border-hover: var(--dc-brand-mediumred);
        --com-c-button-secondary-color-border-focus: var(--dc-brand-mediumred);
        --com-c-button-secondary-color-border-active: var(--dc-brand-mediumred);
        --com-c-button-secondary-color-background: #fff;
        --com-c-button-secondary-color-background-hover: var(--dxp-s-secondary-button-color-hover);
        --com-c-button-secondary-color-background-focus: var(--dxp-s-secondary-button-color-hover);
        --com-c-button-secondary-color-background-active: var(--dxp-s-secondary-button-color-hover);
        --com-c-action-button-tertiary-color: var(--dc-brand-red);
        --com-c-action-button-tertiary-color-hover: var(--dc-brand-mediumred);
        --com-c-action-button-tertiary-color-focus: var(--dc-brand-mediumred);
        --com-c-action-button-tertiary-color-active: var(--dc-brand-mediumred);
    }
}

.custom-login-page {
    .logo-anchor {
        --dxp-c-link-color-background: var(--dc-brand-blue);
        --dxp-c-link-color-background-hover: var(--dc-brand-blue);
        --dxp-c-link-color-background-focus: var(--dc-brand-blue);

        width: max-content;
        margin: 0 auto var(--dxp-g-spacing-small);
        border-radius: 4px;

        img {
            margin: var(--dxp-g-spacing-medium);
        }
    }
}

commerce-dropdown button.slds-button {
    color: var(--dc-brand-blue);
}

.custom-expandable-section {
    commerce-search-filters-panel-section {
        .section-style {
            padding: 0;
        }

        .section-header {
            background-color: var(--dc-brand-lightblue);
            padding: var(--dxp-g-spacing-medium);
        }

        #categories-section {
            padding: var(--dxp-g-spacing-medium);
        }
    }

    commerce_search-facet-item:first-of-type {
        margin-top: var(--dxp-g-spacing-medium);
    }

    commerce_search-facet-item:last-of-type {
        margin-bottom: var(--dxp-g-spacing-medium);
    }

    commerce_search-facet-item {
        margin: 0 var(--dxp-g-spacing-medium);
    }
}

.custom-tile {
    --dxp-s-text-heading-medium-font-family: 'Open Sans', sans-serif;

    commerce_search-product-grid .product-grid-container {
        padding-top: 0.25rem;
        margin-top: calc(-1 * var(--dxp-g-spacing-medium));
    }

    .cardContainerGrid {
        padding: 0 !important;
        margin: var(--dxp-g-spacing-medium);
        border-width: 1px !important;
        border-color: var(--slds-g-color-palette-neutral-80) !important;
        grid-template-rows: min-content min-content auto min-content min-content min-content min-content min-content !important;

        .imageArea img {
            aspect-ratio: 3 / 2;
            object-fit: cover;
        }

        .fieldsArea,
        .priceArea {
            --dxp-s-text-heading-medium-font-size: 1rem;
            --com-c-product-field-font-weight: 700;
            --dxp-s-text-heading-medium-line-height: 1.25;

            width: 100%;
            padding: var(--dxp-g-spacing-xsmall) var(--dxp-g-spacing-small) !important;
        }
    }

    .priceArea {
        background-color: var(--slds-g-color-palette-neutral-95);
    }

    commerce_search-product-field:not(:first-of-type) span {
        font-weight: 400;
    }

    /* remove truncation effects from product titles */
    .slds-truncate {
        overflow: initial;
        text-overflow: initial;
        white-space: initial;
        color: var(--dxp-g-root-contrast);
    }
}

.custom-cart-items {
    .container {
        p {
            --dxp-c-l-text-block-font-weight: 700;
        }
    }
}

.footer-bottom-links {
    display:flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    margin-top: 1.5rem;
    color: white;

    li {
        flex: 1 0 100%;
        margin-bottom: 0.75rem;
    }
}

@media screen and (min-width: 768px) {
    .two-column-link-list {
        ul {
            column-count: 2;
            column-gap: 1rem;
        }
    
        li {
            break-inside: avoid;
        }
    }

    .footer-bottom-links li {
        flex: 1 0 auto;
        margin-bottom: 0;
        text-align: center;
    }
}

/* TODO - refactor this "custom-directory" CSS for the About Us page, most if not all should be achievable by SLDS classes */
.custom-directory {
     /* Colors */
    --cd-text-primary: #333333;
    --cd-text-secondary: var(--dc-brand-darkgray);
    --cd-border-color: #dee2e6;
    --cd-link-color: var(--dc-brand-blue);
    --cd-link-hover-opacity: 0.8;
    
    /* Spacing */
    --cd-gutter-x: 1.5rem;              /* 24px - horizontal spacing */
    --cd-gutter-y: 0;                   /* vertical gutter (not used) */
    --cd-row-padding: 1.875rem;         /* 30px - row vertical padding */
    --cd-row-padding-mobile: 1.25rem;   /* 20px - mobile row padding */
    --cd-item-spacing: 0.375rem;        /* 6px - list item spacing */
    --cd-name-spacing: 0.625rem;        /* 10px - name bottom margin */
    --cd-mobile-spacing: 0.9375rem;     /* 15px - mobile bottom margin */
    
    /* Typography */
    --cd-font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    --cd-font-size-base: 0.875rem;      /* 14px */
    --cd-font-size-heading: 1.125rem;   /* 18px */
    --cd-font-weight-semibold: 600;
    --cd-line-height-base: 1.5rem;
    
    /* Layout */
    --cd-avatar-size: 90px;
    --cd-col-image-width: 16.666%;      /* ~2/12 columns */
    --cd-col-details-width: 41.666%;    /* ~5/12 columns */
    --cd-col-info-width: 41.666%;       /* ~5/12 columns */

    font-family: var(--cd-font-family);
    color: var(--cd-text-primary);
    font-size: var(--cd-font-size-base);
    overflow:hidden;

    .contact-row {
        padding: var(--cd-row-padding) 0;
        border-bottom: 1px solid var(--cd-border-color);
    }

    .contact-row:last-child {
        border-bottom: none;
    }

    .slds-avatar {
        width: var(--cd-avatar-size);
        height: var(--cd-avatar-size);
        border-radius: 50%;
        object-fit: cover;
    }

    .slds-text-link {
        color: var(--cd-link-color);
        text-decoration: underline;
        transition: opacity 0.2s ease;
    }

    .slds-text-link:hover {
        color: var(--cd-link-color);
        opacity: var(--cd-link-hover-opacity);
    }

    img[width="15"] {
        vertical-align: middle;
    }

    .slds-item {
        margin-bottom: var(--cd-item-spacing);
        line-height: var(--cd-line-height-base);
    }

    .contact-name {
        margin-bottom: var(--cd-name-spacing);
    }

    .slds-text-link:focus {
        outline: 2px solid var(--cd-link-color);
        outline-offset: 2px;
    }
}

@media screen and (max-width: 768px) {
    .custom-directory .contact-row {
        padding: var(--cd-row-padding-mobile) 0;
    }

    .custom-directory .slds-text-align_center {
        text-align: left !important;
    }

    .custom-directory .slds-col {
        margin-bottom: var(--cd-mobile-spacing);
    }

    .custom-directory .slds-text-link {
        display: inline-block;
        min-height: 44px;
        line-height: 1.5;
        padding: 0.25rem 0;
    }
}
/* End TODO */
