/* * {
  outline: 1px solid red;
} */

/* Root color and font variables */
:root {
    --main-color: #1B75C1;
    --second-color: #FCC126;
    /* --third-color: #198754; */
    --font-size: 16px;
}

html {
    height: 100%;
}

body {
    height: calc(100vh - 164px);
    font-size: 0.9rem !important;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

header {
    background-color: white;
    z-index: 1040;
}

.header-container {
    padding-top: 140px;
}

/* Fix the controls container (sorting, filter) */
.controls-fixed {
    position: fixed;
    top: 148px;
    width: 100%;
    background-color: white;
    z-index: 1020;
    padding: 1rem 0;
}

.controls {
    margin-right: 15px;
}

.section-font {
    font-size: 24px;
}

/* .categories-toggle {
    position: fixed;
    top: calc(164px + 100px); /* header + title height */
    /* background-color: red;
    z-index: 1010;
    padding: 1rem;
} */

/* Sticky sidebar for ≥lg screens */
.categories-container {
    position: fixed;
    top: 245px;
    left: 0;
    width: 20%;
    height: calc(100vh - (164px + 150px));
    overflow-y: auto;
    background-color: white;
    padding: 1rem;
    z-index: 1020;
    box-shadow: 1px 0 4px rgba(0,0,0,0.05);
}

.categories-container-catalog {
    position: fixed;
    top: 265px;
    left: 0;
    width: 20%;
    height: calc(100vh - (164px + 150px));
    overflow-y: auto;
    background-color: white;
    padding: 1rem;
    z-index: 1020;
    box-shadow: 1px 0 4px rgba(0,0,0,0.05);
}

/* Category list (top-level) */
.category-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.category {
    font-weight: bold !important;
    margin-bottom: 1rem;
    padding-left: 0.5rem; /* slight left spacing */
    color: #222;
}

.category-link {
    text-decoration: none;
    color: #222;
}

.subcategory-link {
    text-decoration: none;
    color: #333;
}

.category-link:hover,
.subcategory-link:hover {
    text-decoration: none;
}

.category-dropdown {
    /* font-weight: !important; */
    margin-bottom: 0.5rem;
    padding-left: 0.5rem; /* slight left spacing */
}

/* Subcategory list with custom dots */
.subcategory-list {
    list-style: none;
    margin-top: 0.5rem;
    padding-left: 1.5rem;
    text-decoration: none;
    color: #333;
}

.subcategory-list li {
    position: relative;
    padding-left: .5rem;
    margin-bottom: 0.4rem;
    font-weight: normal;
    font-size: 0.95rem;
    color: #333;
    text-decoration: none;
}

/* Push catalog content lower */
.catalog-wrapper {
    padding-top: calc(115px);
}

/* Push form content lower with less padding than catalog */
.form-wrapper {
    padding-top: calc(70px);
}

.carousel-frame {
    max-height: 250px;
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 10px;
}

.carousel-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Font Source Sans Pro */
@font-face {
    font-family: 'Source Sans Pro';
    src: url('/static/fonts/SourceSansPro-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.icon {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    height: 1.5rem;
    width: 1.5rem;
    color: var(--main-color);
}

.btn-blue {
    background: var(--main-color);
    color: white;
}

.btn-grey {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-right: 10px;
    font-size: 0.8rem !important;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.text-blue {
    color: var(--main-color) !important;
    font-size: 0.8rem;
}

/* Logo image */
#logo,
#logo-md {
    background-image: url('/static/images/fayno_logo_transparent_book.webp');
    width: 70px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    flex-shrink: 0;
    margin-right: -8px;
    margin-left: 0px;
}

/* Logo container for flex alignment */
.logo-container {
    display: flex;
    align-items: center;
    max-width: 200px;
}

/* Small logo container for mobile */
.logo-container-small {
    max-width: 100px;
}

/* Improve spacing for small screens */
@media (max-width: 575px) {
    .logo-container-small {
        max-width: 85px;
    }
    
    .logo-title {
        font-size: 0.9rem;
    }
    
    .logo-subtitle {
        font-size: 0.55rem;
    }
    
    .fa-lg {
        font-size: 1.1em !important;
    }
    
    .text-blue {
        font-size: 0.8rem;
    }
    
    /* Adjust list items spacing */
    .list-inline-item {
        margin-right: 0.5rem;
    }
    
    /* Add extra padding to create more space */
    .pr-3 {
        padding-right: 1rem !important;
    }
    
    /* Make logo area more compact */
    .logo-container-small .logo-text {
        line-height: 1.1;
    }
    
    /* Make dropdown menu font smaller on mobile */
    .dropdown-menu .dropdown-item {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    /* Ensure proper spacing between logo and icons */
    .d-sm-none .col-5:first-child {
        padding-right: 0.25rem !important;
    }
    
    .d-sm-none .col-5:last-child {
        padding-left: 0.25rem !important;
    }
    
    /* Make sure the spacer column is visible */
    .d-sm-none .col-2 {
        min-width: 16.66667% !important;
        flex: 0 0 16.66667% !important;
    }
    
    /* Mobile cart optimizations */
    .d-block.d-md-none .card {
        margin-bottom: 0.5rem !important;
    }
    
    .d-block.d-md-none .card-body {
        padding: 0.5rem !important;
    }
    
    .d-block.d-md-none .card-title {
        font-size: 0.9rem !important;
        font-weight: normal !important;
        margin-bottom: 0.25rem !important;
    }
    
    .d-block.d-md-none .card-text {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .d-block.d-md-none .card-text small {
        font-size: 0.7rem !important;
    }
    
    .d-block.d-md-none .row {
        margin: 0 !important;
    }
    
    .d-block.d-md-none .row [class*="col-"] {
        padding: 0.05rem 0.1rem !important;
    }
    
    .d-block.d-md-none small {
        font-size: 0.75rem !important;
        font-weight: normal !important;
    }
    
    /* Improve price and subtotal readability on mobile */
    .mobile-cart-item .col-3 small strong {
        font-size: 0.8rem !important;
        white-space: nowrap;
    }
}

.nav-link {
    padding: 0 !important;
}

/*
.logo-ornament {
    width: 40%;
    height: 40px;
    background-image: url('/static/images/fayno_logo_transparent_7.webp');
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 10px;
}
*/

/* Logo title styling */
.logo-text h1,
.logo-text h2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 0;
}

/* Logo main title */
.logo-title {
    font-family: 'Volkhov', 'Georgia', 'Times New Roman', serif;
    font-size: 1.5rem;
    color: var(--main-color);
    text-align: center;
    margin: 3px 0 -6px 0;
}

/* Logo subtitle */
.logo-subtitle {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-align: center;
    color: var(--main-color);
    text-transform: uppercase;
    line-height: 0.9;
}

.aspect-ratio-box {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.aspect-ratio-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.bg-blue {
    background-image: url('/static/images/promo_border_7.webp');
    background-repeat: repeat-x;
    background-size: auto 100%; /* scales the pattern to fill the row height */
    background-position: center;
}

.overlay {
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    position: fixed;
    background: white;
    z-index: -1;
}

#loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255,255,255,0.7);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

#loading-overlay .spinner-border {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.promo-font {
    display: inline-block;
    background-color: white;
    padding: 0 1rem;
    line-height: 1.2;
    color: var(--main-color);
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    text-transform: uppercase;
    font-size: 1.1rem;
}

.fa-lg {
    font-size: 1em !important;
}

#search {
    min-width: 150px;
    max-width: 350px;
}

.buy-btn {
    background-color: var(--second-color) !important;
    font-size: 0.8rem !important;
    width: auto !important;
    min-width: fit-content !important;
    min-height: fit-content !important;
    max-width: 130px !important;
    display: inline-block !important;
}

.btn-edit {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.btn-edit:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    color: white !important;
}

.btn-delete {
    background-color: var(--second-color) !important;
    border-color: var(--second-color) !important;
    color: white !important;
}

.btn-delete:hover {
    background-color: #e6a800 !important;
    border-color: #d39e00 !important;
    color: white !important;
}

.btn-cancel {
    background-color: var(--second-color) !important;
    border-color: var(--second-color) !important;
    color: white !important;
}

.btn-cancel:hover {
    background-color: #e6a800 !important;
    border-color: #d39e00 !important;
    color: white !important;
}

.dropdown-menu {
    z-index: 1050;
    font-size: 0.8rem;
}

/* Override for description textarea */
#description-textarea {
    font-size: 13px !important;
    padding: 8px 12px !important;
    resize: vertical;
}

.form-control {
    /* max-width: 100px; */
    padding: 2px 4px !important;
    font-size: 0.8rem !important;
}

/* Hide number input spinners/arrows */
.qty_input::-webkit-outer-spin-button,
.qty_input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty_input {
    -moz-appearance: textfield;
}

.img-fluid {
    max-width: 90% !important;
}

/* Custom file input styling */
.btn-file {
    position: relative;
    overflow: hidden;
    background-color: var(--main-color);
    color: white;
    border: 1px solid var(--main-color);
}

.btn-file:hover {
    background-color: #1e6bb8;
    border-color: #1e6bb8;
    color: white;
}

.btn-file input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 100px;
    text-align: right;
    opacity: 0;
    outline: none;
    background: white;
    cursor: inherit;
    display: block;
}

.btn-black {
    background-color: #000;
    border-color: #000;
    color: white;
}

.btn-black:hover {
    background-color: #333;
    border-color: #333;
    color: white;
}

/* .bag-notification-wrapper {
    height: 100px;
    overflow-x: hidden;
    overflow-y: auto;
} */


/* ------------------------------- bootstrap toasts */

.message-container {
    position: fixed;
    top: 72px;
    right: 15px;
    z-index: 99999999999;
}

.custom-toast {
    overflow: visible;
}

.toast-capper {
    height: 2px;
}

/* ------------------------------------------------------ */
@media (min-width: 350px) {
    .col-6-custom {
        flex: 0 0 80% !important;
        max-width: 80% !important;
    }

    .controls-fixed {
        top: 128px;
    }
}

@media (min-width: 400px) {
    #logo,
    #logo-md {
        width: 90px;
        height: 70px;
    }

    .col-6-custom {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    /* .nav-link {
        padding: .4rem 0.9rem !important;
    } */

    .logo-title {
        font-size: 1.9rem;
    }

    .logo-subtitle {
        font-size: 1rem;
    }

    .fa-lg {
        font-size: 1.25em !important;
    }

    .header-container {
        padding-top: 150px;
    }

    .text-blue {
        font-size: 0.9rem;
    }
}

@media (min-width: 576px) {
    .header-container {
        padding-top: 124px;
    }

    .controls-fixed {
        top: 102px;
    }

    .col-6-custom {
        flex: 0 0 33% !important;
        max-width: 33% !important;
    }

    /* Cart horizontal layout for tablets and desktops ≥576px */
    .mobile-cart-item {
        display: none !important;
    }

    .cart-table-item {
        display: block !important;
    }

    /* Cart header row for larger screens */
    .cart-header-row {
        display: flex !important;
        align-items: center;
        padding: 0.5rem 1rem;
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
        margin: 0;
        font-weight: bold;
        font-size: 0.9rem;
    }

    .cart-header-image {
        flex: 0 0 60px;
        margin-right: 0.5rem;
        text-align: center;
    }

    .cart-header-info {
        flex: 1 1 auto;
        min-width: 150px;
        margin-right: 0.5rem;
    }

    .cart-header-price {
        flex: 0 0 60px;
        text-align: center;
        margin-right: 0.5rem;
    }

    .cart-header-quantity {
        flex: 0 0 100px;
        text-align: center;
        margin-right: 0.5rem;
    }

    .cart-header-delete {
        flex: 0 0 30px;
        text-align: center;
        margin-right: 0.5rem;
    }

    .cart-header-subtotal {
        flex: 0 0 60px;
        text-align: center;
        margin-right: 0;
    }

    .cart-horizontal-row {
        display: flex !important;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
        margin: 0;
    }

    .cart-image-col {
        flex: 0 0 60px;
        max-width: 60px;
        margin-right: 0.5rem;
    }

    .cart-info-col {
        flex: 1 1 auto;
        min-width: 150px;
        margin-right: 0.5rem;
    }

    .cart-price-col {
        flex: 0 0 60px;
        text-align: center;
        margin-right: 0.5rem;
    }

    .cart-quantity-col {
        flex: 0 0 100px;
        text-align: center;
        margin-right: 0.5rem;
    }

    .cart-subtotal-col {
        flex: 0 0 60px;
        text-align: center;
        margin-right: 0.5rem;
    }

    .cart-delete-col {
        flex: 0 0 30px;
        text-align: center;
        margin-right: 0;
    }

    .cart-info-col h6 {
        margin-bottom: 0.25rem;
        font-size: 1rem;
    }

    .cart-info-col .author-info {
        font-size: 0.875rem;
        color: #6c757d;
        margin-bottom: 0.125rem;
    }

    .cart-info-col .publisher-info {
        font-size: 0.875rem;
        color: #6c757d;
    }
}

@media (min-width: 776px) {
    .body {
        font-size: 0.9rem;
    }
    .btn-grey {
        font-size: 1rem !important;
    }

    #logo,
    #logo-md {
        width: 120px;
        height: 100px;
    }

    .nav-link {
        padding: .5rem 1rem !important;
    }

    .logo-title {
        font-size: 2.5rem;
    }

    .logo-subtitle {
        font-size: 1.3rem;
    }

    .nav-text {
        font-size: 100%;
    }

    .promo-font {
        font-size: 1.5rem;
    }

    .header-container {
        padding-top: 160px;
    }

    .controls-fixed {
        top: 159px;
    }

    .col-6-custom {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }

    .catalog-wrapper {
        padding-top: calc(130px);
    }
}

@media (min-width: 992px) {
    .fixed-top-desktop-only {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 1030;
    }

    .product-container {
        margin-left: 25%;
    }

    .offset-lg-2 {
        margin-left: 25% !important;
    }

    .catalog-wrapper {
        padding-top: calc(112px);
    }
}