/* Custom Styles for Client Shopping Site */

:root {
    --dfab-blue: #74bddc;
    --dfab-orange: #f8a72d;
    --crave-orange: #ff8c00;
    --dark-gray: #333333;
    --light-gray: #f8f9fa;
    --medium-gray: #666666;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Container Min-Height */
div.container.min-height {
    min-height: 350px;
}

/* Header Styles */
.site-header {
    background-color: white;
    padding: 1rem 0;
}

.logo-dfab img {
    max-height: 60px;
}

.search-bar {
    max-width: 500px;
}

.search-bar .btn-primary {
    background-color: var(--dfab-blue);
    border-color: var(--dfab-blue);
}

.search-bar .btn-primary:hover {
    background-color: #5da9c9;
    border-color: #5da9c9;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-section {
    padding: 0.5rem 0;
}

.search-section:not(:last-child) {
    border-bottom: 1px solid #dee2e6;
}

.search-section h6 {
    padding: 0.5rem 1rem;
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--dark-gray);
    text-decoration: none;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: var(--light-gray);
}

.search-result-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 1rem;
    background: #f8f9fa;
    padding: 0.25rem;
    border-radius: 4px;
}

.search-result-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
    color: var(--dfab-blue);
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 500;
    color: var(--dark-gray);
}

.search-result-code {
    font-size: 0.875rem;
    color: #666;
}

.search-no-results {
    padding: 2rem 1rem;
    text-align: center;
    color: #666;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Hamburger Menu */
.hamburger-menu {
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    margin-left: 0.5rem;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 4px;
    background-color: #1192cb;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

.download-catalog {
    color: var(--dfab-blue);
    text-decoration: none;
    font-weight: 500;
}

.download-catalog:hover {
    color: #5da9c9;
}

.btn-primary {
    background-color: var(--dfab-orange);
    border-color: var(--dfab-orange);
}

.btn-primary:hover {
    background-color: #ff8c1a;
    border-color: #ff8c1a;
}

.btn-outline-primary {
    color: var(--dfab-blue);
    border-color: var(--dfab-blue);
}

.btn-outline-primary:hover {
    background-color: var(--dfab-blue);
    border-color: var(--dfab-blue);
    color: white;
}

.cart-icon {
    position: relative;
    font-size: 1.5rem;
    color: var(--dark-gray);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--dfab-blue);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Navigation Menu */
.main-nav {
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 998;
}
/* Hide mobile close button on desktop */
.mobile-menu-close {
    display: none;
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
}

.main-nav .nav-link {
    color: #0c5a7d !important;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: background-color .5s ease, color .5s ease;
}

.main-nav .nav-link:hover {
    background-color: #e9ecef;
    color: black !important;
}

#nav-menu {
    margin-right: -22px;
}

.main-nav .dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
}

.main-nav .dropdown-menu {
    background-color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.main-nav .dropdown-item {
    color: var(--dark-gray);
    padding: 0.5rem 1.5rem;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.main-nav .dropdown-item:hover {
    background-color: #e9ecef;
    color: black;
}

/* Client Branding Section */
.client-section {
    background-color: var(--light-gray);
    padding: 1rem 0;
}

.client-logo {
    max-height: 80px;
}

.breadcrumb {
    background-color: transparent;
    margin-bottom: 0;
}

/* Product Grid */
.product-grid {
    padding: 2rem 0;
}

.product-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-image {
    background-color: #f8f9fa;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    text-decoration: none;
}

.product-image img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.product-title a {
    color: var(--dark-gray);
    text-decoration: none;
}

.product-title a:hover {
    color: var(--dfab-blue);
}

.product-description {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
    flex-grow: 1;
}

.request-info-btn {
    background-color: var(--dfab-orange);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    width: 100%;
    margin-top: auto;
    transition: background-color 0.3s ease;
}

.request-info-btn:hover {
    background-color: #ff8c1a;
}

/* Resource Cards */
.resource-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.resource-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Resource Preview */
.resource-preview {
    position: relative;
    width: 100%;
    background: #f8f9fa;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.resource-preview img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 200px;
}

.resource-preview video {
    width: 100%;
    height: auto;
    max-height: 200px;
    background: #000;
}

.resource-preview .pdf-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.resource-preview .pdf-thumbnail {
    display: none;
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
}

.resource-preview .pdf-loading {
    color: #6c757d;
    font-size: 0.9rem;
}

.resource-preview a {
    display: block;
    position: relative;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.preview-overlay i {
    font-size: 4rem;
    color: white;
    opacity: 0.9;
}

.resource-preview a:hover .preview-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.resource-icon {
    font-size: 3rem;
    color: var(--dfab-blue);
    padding: 2rem 0;
    text-align: center;
}

.resource-content {
    flex-grow: 1;
    padding: 1.5rem;
}

.resource-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: #e7f5fb;
    color: var(--dfab-blue);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.resource-type-badge i {
    font-size: 1rem;
}

.resource-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.resource-link {
    color: var(--dark-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.resource-link:hover {
    color: var(--dfab-blue);
    text-decoration: underline;
}

.resource-description {
    font-size: 0.9rem;
    color: var(--medium-gray);
    margin-bottom: 0;
}

.resource-actions {
    padding: 0 1.5rem 1.5rem;
    text-align: center;
}

.resource-actions .btn {
    width: 100%;
}

/* Video Player */
.video-player-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.video-player {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh;
}

.fullscreen-btn {
    position: absolute;
    bottom: 60px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
    z-index: 10;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.fullscreen-btn i {
    display: block;
}

/* Fullscreen video adjustments */
.video-player-container:fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-player-container:fullscreen .video-player {
    max-height: 100vh;
    max-width: 100vw;
    width: auto;
    height: auto;
}

.video-player-container:fullscreen .fullscreen-btn {
    bottom: 20px;
    right: 20px;
}

/* WebKit fullscreen support */
.video-player-container:-webkit-full-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-player-container:-webkit-full-screen .video-player {
    max-height: 100vh;
    max-width: 100vw;
    width: auto;
    height: auto;
}

/* Footer */
.site-footer {
    background-color: #555555;
    color: white;
    /* padding: 3rem 0 1rem; */
    margin-top: 3rem;
}

.footer-section h5 {
    color: var(--dfab-blue);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    padding: 1rem;
    text-align: center;
    color: #CCC;
    font-size: 0.875rem;
}

.footer-bottom a {
    color: #CCC;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: white;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .container {
        margin-left: 25px !important;
        margin-right: 25px !important;
        max-width: calc(100% - 50px) !important;
        width: calc(100% - 50px) !important;
    }
    
    .download-catalog .download-text {
        display: none;
    }
    
    .header-actions .cart-text {
        display: none !important;
    }
}

@media (max-width: 991px) {
    #nav-menu {
        margin-right: 0;
        justify-content: flex-start !important;  /* ADD THIS LINE */
    }
    /* Mobile Navigation */
    .main-nav .nav {
        display: flex;
        flex-direction: column;
        width: 70%;
        max-width: 350px;
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        background-color: white;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
        z-index: 1001;
        overflow-y: auto;
        padding-top: 4rem;
        transition: right 0.5s ease;
    }
    
    .main-nav .nav.mobile-active {
        right: 0;
    }
    
    /* Mobile Menu Close Button */
    .mobile-menu-close {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #dee2e6;
        display: flex;
        justify-content: flex-end;
        list-style: none;
    }
    
    .close-menu-btn {
        background: none;
        border: none;
        color: #333;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s ease;
    }
    
    .close-menu-btn:hover {
        transform: scale(1.1);
    }
    
    .main-nav .nav-item {
        width: 100%;
        border-bottom: 1px solid #dee2e6;
    }
    
    .main-nav .nav-link {
        padding: 1rem 1.5rem;
        display: block;
        color: #0c5a7d !important;
    }
    
    .main-nav .dropdown-menu {
        position: static;
        float: none;
        border: none;
        box-shadow: none;
        background-color: #f8f9fa;
        margin: 0;
        border-radius: 0;
    }
    
    .main-nav .dropdown-item {
        color: var(--dark-gray) !important;
        padding: 0.75rem 2rem;
    }
    
    .main-nav .dropdown-item:hover {
        background-color: #e9ecef;
        color: black !important;
    }
    
    .main-nav {
        position: static; /* Revert position for mobile */
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .product-grid {
        padding: 1rem 0;
    }
}

@media (max-width: 400px) {
    /* Full width menu on very small screens */
    .main-nav .nav {
        width: 90%;
        max-width: 90%;
    }
}

/* Toast notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 350px;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.toast-success {
    background-color: #28a745;
}

.toast-notification.toast-error {
    background-color: #dc3545;
}

.toast-notification.toast-info {
    background-color: var(--dfab-blue);
}

/* Add to cart button */
.btn-add-to-cart,
button.btn-add-to-cart {
    background-color: var(--dfab-blue) !important;
    border-color: var(--dfab-blue) !important;
    color: white !important;
}

.btn-add-to-cart:hover,
button.btn-add-to-cart:hover {
    background-color: #5da9c9 !important;
    border-color: #5da9c9 !important;
    color: white !important;
}

/* Product page add to cart button - 50% width on desktop */
@media (min-width: 768px) {
    .product-page-add-btn {
        width: 50%;
    }
}

.btn-add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Quote cart table */
.quote-cart-table {
    background-color: white;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.quantity-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls .qty-input {
    width: 45px;
    text-align: center;
}

.quote-cart-table thead {
    background-color: var(--dfab-blue);
    color: white;
}

.quote-cart-table tfoot {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Price and subtotal alignment */
.quote-cart-table td[data-label="Price: "],
.quote-cart-table td[data-label="Subtotal: "] {
    text-align: right;
}

/* Mobile cart styling */
@media (max-width: 768px) {
    .quote-cart-table {
        font-size: 0.875rem;
    }
    
    .quote-cart-table thead {
        display: none;
    }
    
    .quote-cart-table tbody tr {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 1rem;
        background-color: white;
    }
    
    .quote-cart-table tbody td {
        display: block;
        border: none;
        padding: 0.5rem 0;
        text-align: left !important;
    }
    
    .quote-cart-table tbody td::before {
        content: attr(data-label);
        font-weight: bold;
        display: inline-block;
        width: 100px;
        color: #495057;
    }
    
    .cart-item-image {
        width: 100%;
        height: auto;
        max-width: 200px;
        margin-bottom: 0.5rem;
    }
    
    .quote-cart-table tbody td:first-child {
        border-bottom: 2px solid #dee2e6;
        padding-bottom: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .quote-cart-table tbody td:first-child .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .quantity-controls {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
    
    .quote-cart-table tfoot tr {
        display: block;
        background-color: var(--dfab-blue);
        color: white;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .quote-cart-table tfoot td {
        display: inline;
        border: none;
        padding: 0;
    }
    
    .quote-cart-table tfoot td:first-child {
        margin-right: 1rem;
    }
}

/* Remove padding from the last navigation item */
.nav-item-last {
	padding-right: 0px !important;
}

