/* Google Font import */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Lexend+Mega:wght@100..900&display=swap');

/* VARIABLES */
:root {
    --headings-font: "Lexend Mega", cursive;
    --main-font: "DM Sans", sans-serif;
    --primary-color: #1C3738; /* Gunmetal */
    --secondary-color: #8BAAAD; /* Cadet Gray */
    --tertiary-color: #E3E3E3; /* Light Gray */
    --highlight-color: #F4FFF8; /* Mint cream */
}

/* GLOBAL STYLES */
html {
    height: 100%;
}

body {
    /* Translucent gradient used over background to improve contrast with lead text */
    background: 
        linear-gradient(rgba(255, 255, 255, 0.23), rgba(255, 255, 255, 0.23)),
        url('/media/snow-depot-hero-image.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--primary-color);
    font-family: var(--main-font);
    margin: 0; /* Remove default browser margin to avoid top gap */
}

h1, h2, .dropdown-category {
    font-family: var(--headings-font);
    color: var(--primary-color);
}

h1, .h1 {
    font-family: var(--headings-font), sans-serif;
}

.capital-font {
    text-transform: uppercase !important;
    font-family: var(--headings-font), sans-serif !important;
}

.highlight-font {
    color: var(--highlight-color);
    font-weight: bold;
}


.main-logo-link {
    width: fit-content;
}

.shop-now-button {
    background: var(--primary-color);
    color: white;
    min-width: 260px;
}

.btn-black {
    background: var(--primary-color) !important; 
    color: white;
}

.btn-black:hover {
    background: var(--secondary-color) !important; 
}

.btn-outline-black:hover {
    background-color: var(--tertiary-color);
}

.shop-now-button:hover,
.shop-now-button:active,
.shop-now-button:focus,
.btn-black:hover,
.btn-black:active,
.btn-black:focus {
    background: var(--primary-color);
    color: white;
}

.text-black {
    color: var(--primary-color) !important;
}

.border-black {
    border: 1px solid var(--primary-color) !important;
}

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

/* from Bulma */
.icon {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    height: 1.5rem;
    width: 1.5rem;
}
/* TOAST MESSAGES */
.message-container {
    position: fixed;
    right: 20px;
    z-index: 9999;
}

.custom-toast {
    overflow: visible;
}

.toast-capper {
    height: 4px;
}

.toast-product-image {
    width: 60px;
    height: 80px;
    object-fit: cover;
}

.toast-icon {
    width: 20px;
    height: 20px;
    object-fit: cover;
}


/* NAVIGATION */

.navbar {
    background-color: var(--highlight-color);
}

/* Dropdown item active state override to Gunmetal */
.dropdown-menu .dropdown-item:active,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item.active {
    background-color: var(--primary-color) !important; /* Gunmetal */
    color: #fff !important;
}

/* Fix vertical alignment of navbar search button with the input */
.navbar .input-group .btn {
    height: calc(1.5em + .75rem + 2px); /* Match .form-control default height (Bootstrap 4) */
    line-height: 1.5;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
}

/* Slightly reduce the icon box to avoid overflow */
.navbar .input-group .btn .icon {
    height: 1.25rem;
    width: 1.25rem;
}

/* HOMEPAGE */

/* Partners floating button and menu */
.partners-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 999;
}

.partners-menu {
  position: fixed;
  right: 16px;
  bottom: 64px; /* leave room for the button */
  max-width: 320px;
  z-index: 999;
}

.partners-toggle .rotate-icon {
  transition: transform 0.2s ease;
}

.partners-toggle.collapsed .rotate-icon {
  transform: rotate(180deg);
}

/* Dark theme for partners menu */
.partners-menu .card,
.partners-menu .card-body {
  background-color: var(--primary-color);
  color: #fff;
}

.partners-menu .card {
  border-color: var(--primary-color);
}

.partners-menu .table {
  color: #fff;
  background-color: transparent;
}

/* Override Bootstrap thead light background */
.partners-menu .table thead th,
.partners-menu .thead-light th {
  color: #fff;
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.25);
}

.partners-menu .table tbody td {
  border-color: rgba(255, 255, 255, 0.15);
}


/* BASKET */

.basket-product-image {
    width: 80px;
    height: 120px;
    object-fit: cover;
}

.basket-qty-input {
    width: 50px;
}


/* ALLAUTH TEMPLATES */

.allauth-form-inner-content p {
    margin-top: 1rem;
    color: var(--primary-color);
}

.allauth-form-inner-content input {
    border-color: var(--primary-color);
    border-radius: 0;
}

.allauth-form-inner-content label:not([for='id_remember']) {
    display: none;
}

/* PRODUCTS */

/* Product cards: consistent footer alignment */
.product-container .card {
    display: flex;
    flex-direction: column;
}

.product-container .card .card-footer {
    margin-top: auto;
}

/* Product form: fix image field */
.btn-file {
    position: relative;
    overflow: hidden;
}

.btn-file input[type="file"] {
    position: absolute;
    top: 0;
    right: 0;
    min-height: 100%;
    min-width: 100%;
    opacity: 0;
    cursor: pointer;
}

.custom-checkbox .custom-control-label::before {
    border-radius: 0;
    border-color: #dc3545; /* Matches Bootstrap text-danger class */
}

.custom-checkbox .custom-control-input:checked~.custom-control-label::before {
    background-color: #dc3545; /* Matches Bootstrap text-danger class */
    border-color: #dc3545; /* Matches Bootstrap text-danger class */
    border-radius: 0;
}

/* REVIEWS */
.review-list {
    list-style: none;
}




/* -------------------------------- Media Queries */

/* Slightly larger container on xl screens */
@media (min-width: 1200px) {
    .container {
        max-width: 80%;
    }
}

/* fixed top navbar only on medium and up */
@media (min-width: 992px) {
    .fixed-top-desktop-only {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 1030;
    }

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

/* Base styles for layout adjustments */
@media (min-width: 768px) {
    /* Align basket product info to the top of the row on md+ screens */
    .basket-product-image + div {
        align-self: flex-start;
    }
}

/* Reduce logo size on small screens so it fits alongside the burger icon */
@media (max-width: 768px) {
    #header-logo {
        font-size: 1.25rem; /* roughly h5 size */
        margin: 0;
        line-height: 1.2;
    }
}

@media (min-width: 992px) {
    body {
        padding-top: 70px; /* Space for fixed header on larger screens */
    }
}

/* Ensure page content isn't overlapped by the fixed navbar */
@media (max-width: 992px) {
    body {
        padding-top: 0; /* Header is sticky on small screens; no extra top padding needed */
    }
    
    /* Reduce top heading size on small screens */
    #lead-text-header {
        font-size: 2rem;
        line-height: 1.2;
    }
}

/* Align and prevent wrapping of basket link between 992px and 1236px */
@media (min-width: 992px) and (max-width: 1236px) {
    .navbar .nav-link {
        white-space: nowrap; 
    }
}

/* Center category headers in collapsed (mobile) navbar */
@media (max-width: 992px) {
    /* Make the dropdown toggle fill the row and center its label */
    .navbar .dropdown-category.btn {
        display: block;
        width: 100%;
        text-align: center;
        padding-left: 0.75rem; /* balanced horizontal padding */
        padding-right: 0.75rem;
    }

    /* Center dropdown menu items for consistency */
    .navbar .dropdown-menu {
        text-align: center;
    }
}
