/*  ===== CODE MODIFICATION =====
 *  File name    : commons/css/layout-v2.css (web root /var/www/html)
 *  Dev name     : Denish Faldu
 *  Date         : 2026-10-23
 *  Section      : whole file (new)
 *  Purpose      : Improve functionality
 *  Current      : Header / menu / footer styles are spread over style.css, main.css, navbar.css
 *                 and inline styles in the old layouts.
 *  Modification : Shared header, phone menu, footer, modal and back-to-top styles for all
 *                 *_v2 layouts. Uses the variables from site-theme.css. Mobile first.
 *  Related code : app/views/layouts/stand_v2.php (and later *_v2 layouts),
 *                 /commons/css/site-theme.css, /commons/js/layout-v2.js
 *  ============================= */

/* ---------- Page frame: footer stays at the bottom on short pages ---------- */
body.layout-v2 {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1 0 auto;
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--ci-white);
    border-bottom: 2px solid var(--ci-primary-soft);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.site-header .navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-header .navbar-toggler {
    border: 0;
    color: var(--ci-heading);
    font-size: 2rem;
    line-height: 1;
    padding: 0.25rem;
}

.site-header .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 78, 248, 0.2);
}

.site-header .nav-link {
    color: var(--ci-heading);
    font-family: var(--ci-font-heading);
    font-weight: 600;
    padding: 0.75rem 0;
}

.site-header .nav-link:hover,
.site-header .nav-link:focus,
.site-header .nav-link.show {
    color: var(--ci-primary);
}

.site-header .cart-count {
    background: var(--ci-cta-gradient);
    color: var(--ci-white);
    font-size: 0.75rem;
    vertical-align: top;
}

.site-header .nav-btn {
    border-radius: var(--ci-radius-pill);
    display: block;
    margin-top: 0.5rem;
    padding: 0.4rem 1.25rem;
}

/* Phone menu: full-width list under the logo */
@media (max-width: 991.98px) {
    .site-header .navbar-collapse {
        border-top: 1px solid var(--ci-border);
        margin-top: 0.5rem;
        padding-bottom: 1rem;
    }

    .site-header .nav-item + .nav-item .nav-link {
        border-top: 1px solid var(--ci-border);
    }

    .site-header .dropdown-menu {
        border: 0;
        padding-top: 0;
    }
}

/* Desktop menu: one row */
@media (min-width: 992px) {
    .site-logo img {
        height: 48px;
    }

    .site-header .nav-link {
        padding: 0.5rem 0.9rem;
    }

    .site-header .nav-btn {
        margin-top: 0;
        margin-left: 0.5rem;
    }
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--ci-heading);
    color: var(--ci-white);
    flex-shrink: 0;
    font-size: 0.9rem;
    padding: 1.5rem 0;
}

.site-footer a {
    color: var(--ci-white);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
    color: var(--ci-primary-soft);
    text-decoration: underline;
}

.footer-row {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-social {
    display: flex;
    gap: 1rem;
    font-size: 1.4rem;
}

@media (min-width: 768px) {
    .footer-row {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* ---------- Modals ---------- */
.layout-v2 .modal-title {
    color: var(--ci-heading);
    font-family: var(--ci-font-heading);
}

/* terms.php has an inline orange background; keep the text, use the theme look */
.terms-modal .terms-text {
    background: none !important;
    color: var(--ci-text) !important;
    font-size: 1rem !important;
}

.terms-modal .terms-text h1 {
    font-size: 1.5rem;
}

.terms-modal .terms-text h2 {
    font-size: 1.2rem;
}

.terms-modal .terms-text h3 {
    font-size: 1.1rem;
}

.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact-list li {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.contact-list i {
    color: var(--ci-primary);
    font-size: 1.25rem;
}

.contact-list address {
    margin: 0;
}

/* ---------- Back to top ---------- */
.back-to-top {
    align-items: center;
    background: var(--ci-primary);
    border-radius: 50%;
    bottom: 1rem;
    color: var(--ci-white);
    display: flex;
    font-size: 1.75rem;
    height: 44px;
    justify-content: center;
    opacity: 0;
    position: fixed;
    right: 1rem;
    transition: var(--ci-transition);
    visibility: hidden;
    width: 44px;
    z-index: 1020;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--ci-primary-hover);
    color: var(--ci-white);
}
