/* GLADWIN PRODUCT SUITE — CLEAN PRODUCT PAGE */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body.bg-light {
    position: relative;
    min-height: 100vh;
    font-family: "Segoe UI", Arial, sans-serif !important;
    color: #172554;
    background:
            linear-gradient(
                    -45deg,
                    #eef2ff,
                    #e0f2fe,
                    #f5f3ff,
                    #ecfeff,
                    #f0fdf4,
                    #eef2ff
            ) !important;
    background-size: 500% 500%;
    animation: productGradient 18s ease infinite;
}

body.bg-light::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
            radial-gradient(
                    circle at 15% 20%,
                    rgba(99, 102, 241, 0.16),
                    transparent 28%
            ),
            radial-gradient(
                    circle at 85% 75%,
                    rgba(14, 165, 233, 0.14),
                    transparent 30%
            );
}

@keyframes productGradient {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 100%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}

body.bg-light > .container-fluid {
    position: relative;
    z-index: 1;
}

/* NAVBAR — not sticky, so it never covers product cards */
.modern-navbar {
    margin: 16px !important;
    min-height: 72px;
    padding: 10px 28px !important;
    border-radius: 22px !important;
    background: linear-gradient(135deg,rgba(255,255,255,.98),rgba(245,248,255,.98)) !important;
    border: 1px solid rgba(148,163,184,.22) !important;
    box-shadow: 0 15px 35px rgba(30,41,59,.13),0 3px 10px rgba(99,102,241,.08);
    position: relative !important;
    top: auto !important;
    z-index: 1000;
}
.modern-navbar .nav-item-link,
.modern-navbar .nav-register {
    text-decoration:none !important;
    color:#1e293b !important;
    font-size:16px;
    font-weight:650;
    padding:10px 15px;
    border-radius:12px;
    transition:all .25s ease;
}
.modern-navbar .nav-item-link:hover,
.modern-navbar .nav-register:hover { color:#4f46e5 !important; background:linear-gradient(135deg,#eef2ff,#e0f2fe); }
.modern-navbar .nav-logout {
    border:1px solid #c7d2fe !important;
    background:linear-gradient(135deg,#fff,#eef2ff) !important;
    color:#3730a3 !important;
    border-radius:12px !important;
    padding:10px 18px !important;
    font-size:15px; font-weight:650;
}
.modern-navbar .nav-logout:hover { background:linear-gradient(135deg,#6366f1,#8b5cf6) !important; color:#fff !important; border-color:transparent !important; }

/* PAGE */
body.bg-light > .container-fluid {
    width:100%; max-width:1500px; margin:0 auto;
    padding:28px 28px 60px !important;
}
body.bg-light > .container-fluid > .row { align-items:flex-start; }
body.bg-light .alert { border-radius:14px !important; }
body.bg-light .alert-success { border:none !important; background:linear-gradient(135deg,#dcfce7,#d1fae5) !important; color:#166534 !important; }

/* ADMIN FORM */
.admin-product-card {
    border:none !important; border-radius:18px !important; overflow:hidden;
    background:rgba(255,255,255,.97) !important;
    box-shadow:0 12px 30px rgba(30,41,59,.10) !important;
}
.admin-product-card .card-header { border:none !important; padding:18px 20px !important; font-weight:800; }
.admin-product-card .card-body { padding:22px !important; }
.admin-product-card .form-label { color:#334155 !important; font-weight:700; }
.admin-product-card .form-control,
.admin-product-card .form-select,
.admin-product-card .input-group-text { border:1px solid #dbeafe !important; border-radius:10px !important; }
.admin-product-card .form-control,
.admin-product-card .form-select { padding:10px 12px !important; background:#f8fbff !important; }
.admin-product-card .form-control:focus,
.admin-product-card .form-select:focus { border-color:#6366f1 !important; box-shadow:0 0 0 4px rgba(99,102,241,.12) !important; }
.admin-product-card .btn-primary,
.admin-product-card .btn-warning { border:none !important; border-radius:10px !important; padding:11px !important; font-weight:700; }

/* CUSTOMER AREA */
body.bg-light .col-xl-9.col-lg-8,
body.bg-light .col-xl-10.col-lg-9.col-md-9,
body.bg-light .col-12 { min-width:0; }
body.bg-light .col-xl-9.col-lg-8 > .mb-4 h2 { margin:0 !important; color:#172554 !important; font-size:30px !important; font-weight:800 !important; }
body.bg-light .col-xl-9.col-lg-8 > .mb-4 p { margin-top:4px !important; }

/* HORIZONTAL CATEGORY NAVIGATION */
.category-horizontal-nav {
    width:100%;
    border:1px solid #e2e8f0;
    border-radius:14px;
    background:rgba(255,255,255,.98);
    box-shadow:0 5px 18px rgba(15,23,42,.06);
    overflow:hidden;
}
.category-main-row,
.category-sub-row {
    display:flex;
    align-items:center;
    gap:14px;
    width:100%;
    padding:11px 14px;
}
.category-main-row {
    border-bottom:1px solid #edf2f7;
    background:linear-gradient(90deg,#ffffff,#f8fbff);
}
.category-sub-row {
    background:#fbfdff;
}
.category-nav-label,
.category-sub-label {
    flex:0 0 auto;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.55px;
    font-weight:800;
    color:#64748b;
}
.category-sub-label {
    min-width:76px;
    color:#334155;
}
.category-main-links,
.category-sub-links {
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
    overflow-x:auto;
    scrollbar-width:thin;
    padding-bottom:2px;
}
.category-main-link {
    flex:0 0 auto;
    text-decoration:none !important;
    color:#334155 !important;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:9px;
    padding:8px 15px;
    font-size:13px;
    font-weight:800;
    white-space:nowrap;
    transition:all .2s ease;
}
.category-main-link:hover {
    color:#4338ca !important;
    background:#eef2ff;
    border-color:#c7d2fe;
    transform:translateY(-1px);
}
.category-main-link.active {
    color:#fff !important;
    background:linear-gradient(135deg,#4f46e5,#7c3aed);
    border-color:transparent;
    box-shadow:0 5px 12px rgba(79,70,229,.2);
}
.category-sub-link {
    flex:0 0 auto;
    text-decoration:none !important;
    color:#475569 !important;
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:8px;
    padding:6px 12px;
    font-size:12px;
    font-weight:600;
    white-space:nowrap;
    transition:all .2s ease;
}
.category-sub-link:hover {
    color:#198754 !important;
    background:#f0fdf4;
    border-color:#bbf7d0;
}
.category-sub-link.active {
    color:#198754 !important;
    background:#e8f5e9;
    border-color:#86efac;
    font-weight:800;
}

/* SORT */
body.bg-light .col-xl-10.col-lg-9.col-md-9 > .d-flex { margin-bottom:16px !important; }
body.bg-light .col-xl-10.col-lg-9.col-md-9 > .d-flex .btn {
    border:1px solid #c7d2fe !important; border-radius:9px !important; background:#fff !important;
    color:#3730a3 !important; padding:7px 13px !important; font-size:13px; font-weight:700;
}

/* GRID */
body.bg-light .col-xl-10.col-lg-9.col-md-9 .row-cols-xl-4,
body.bg-light .col-12 .row-cols-xl-4 { --bs-gutter-x:14px; --bs-gutter-y:16px; }

/* PRODUCT CARD */
.product-card {
    position:relative; border:1px solid #e5e7eb !important; border-radius:14px !important;
    background:#fff !important; box-shadow:0 3px 10px rgba(0,0,0,.06) !important;
    overflow:hidden; transition:transform .2s ease,box-shadow .2s ease;
}
.product-card:hover { transform:translateY(-3px); box-shadow:0 8px 20px rgba(0,0,0,.10) !important; }
.product-card .card-body { padding:12px !important; }

/* IMAGE — compact and consistent */
.product-image-box {
    height:175px !important; padding:10px !important;
    display:flex; align-items:center; justify-content:center;
    background:linear-gradient(135deg,#f8fafc,#f0fdf4);
}
.product-image { width:100% !important; height:155px !important; object-fit:contain !important; border-radius:10px !important; transition:transform .2s ease; }
.product-card:hover .product-image { transform:scale(1.04); }
.product-image-box > .d-flex { min-height:155px; width:100%; }

/* DETAILS */
.product-card h6 { font-size:14px !important; line-height:1.35; min-height:38px; margin-bottom:5px !important; color:#172554 !important; }
.product-card .small.text-muted { font-size:12px !important; }
.product-card .fw-bold.fs-5 { font-size:16px !important; white-space:nowrap; }
.product-card .badge { font-size:10px !important; padding:4px 7px !important; border-radius:6px !important; }
.product-card .mt-auto.d-flex { width:100%; gap:8px !important; }

/* ADD BUTTON — prevents AD / D wrapping */
.add-product-btn {
    width:62px !important; min-width:62px !important; height:34px !important;
    padding:0 !important; display:flex !important; align-items:center !important;
    justify-content:center !important; flex-shrink:0 !important; white-space:nowrap !important;
    font-size:13px !important; font-weight:700 !important; border-radius:7px !important;
}

/* OUT OF STOCK */
.out-of-stock-item { width:190px !important; }
.out-of-stock-item .product-card { border-radius:12px !important; }
.out-of-stock-image-box { height:140px !important; display:flex; align-items:center; justify-content:center; }
.out-of-stock-image-box img { width:100%; height:120px !important; object-fit:contain !important; }
.out-of-stock-item .card-body { padding:10px !important; }
.out-of-stock-item h6 { font-size:13px !important; }

/* ADMIN CONTROLS */
.product-card .card-footer { padding:8px 10px !important; }
.product-card .card-footer .btn { font-size:11px !important; padding:5px 6px !important; border-radius:6px !important; }

/* PAGINATION */
body.bg-light .pagination { margin-top:30px !important; gap:6px; justify-content:center; }
body.bg-light .pagination .page-link { border:1px solid #dbeafe !important; border-radius:9px !important; color:#4338ca !important; background:#fff !important; padding:8px 13px !important; font-weight:700; }
body.bg-light .pagination .page-item.active .page-link { color:#fff !important; border-color:transparent !important; background:linear-gradient(135deg,#4f46e5,#7c3aed) !important; }

/* RESPONSIVE */
@media (max-width:1199px) {
    body.bg-light > .container-fluid { padding-left:20px !important; padding-right:20px !important; }
    .product-image-box { height:165px !important; }
    .product-image { height:145px !important; }
}
@media (max-width:991px) {
    body.bg-light .col-xl-3.col-lg-4,
    body.bg-light .col-xl-9.col-lg-8 { width:100%; max-width:100%; }
    .admin-product-card { position:static !important; }

    body.bg-light .col-xl-2.col-lg-3.col-md-3,
    body.bg-light .col-xl-10.col-lg-9.col-md-9 { width:100%; max-width:100%; flex:none; }
}
@media (max-width:768px) {
    .modern-navbar { margin:10px !important; padding:8px 14px !important; border-radius:18px !important; }
    body.bg-light > .container-fluid { padding:20px 14px 45px !important; }
    body.bg-light .col-xl-9.col-lg-8 > .mb-4 h2 { font-size:27px !important; }
    .product-image-box { height:165px !important; }
    .product-image { height:145px !important; }
}

@media (max-width:768px) {
    .category-main-row, .category-sub-row {
        align-items:flex-start;
        flex-direction:column;
        gap:7px;
        padding:10px 12px;
    }
    .category-nav-label, .category-sub-label {
        min-width:0;
    }
    .category-main-links, .category-sub-links {
        width:100%;
    }
}
@media (max-width:480px) {
    .modern-navbar { margin:7px !important; }
    body.bg-light .col-xl-9.col-lg-8 > .mb-4 h2 { font-size:24px !important; }
    .product-image-box { height:155px !important; }
    .product-image { height:135px !important; }
    .out-of-stock-item { width:175px !important; }
}
.success-page {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.success-card {
    background: white;
    padding: 45px;
    text-align: center;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 100%;
}

.success-icon {
    font-size: 70px;
    margin-bottom: 15px;
}

.success-card h1 {
    margin-bottom: 15px;
}

.success-card p {
    font-size: 17px;
    margin-bottom: 30px;
}

.home-button {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
}

/* =========================================
   MOBILE NAVBAR - CLEAN RESPONSIVE FIX
========================================= */

@media (max-width: 991.98px) {

    /* Navbar stays inside the screen */
    .modern-navbar {
        width: calc(100% - 20px) !important;
        margin: 10px !important;
        padding: 8px 14px !important;
        box-sizing: border-box !important;
    }

    /* Brand can shrink instead of pushing the menu button */
    .modern-navbar .modern-brand {
        min-width: 0 !important;
        max-width: calc(100% - 60px) !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

    /* Hamburger stays visible */
    .modern-navbar .navbar-toggler {
        flex-shrink: 0 !important;
        margin-left: auto !important;
    }

    /* Opened mobile menu */
    .modern-navbar .navbar-collapse {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 10px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Stack menu items */
    .modern-navbar .navbar-collapse > div {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        box-sizing: border-box !important;
    }

    /* Navigation links and User Management */
    .modern-navbar .navbar-collapse .nav-item-link,
    .modern-navbar .navbar-collapse .btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
        text-align: left !important;
        white-space: normal !important;
    }

    /* Logout form */
    .modern-navbar .navbar-collapse form {
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Logout button */
    .modern-navbar .navbar-collapse form button {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        text-align: left !important;
    }
}


/* Extra-small phones */
@media (max-width: 480px) {

    .modern-navbar {
        width: calc(100% - 14px) !important;
        margin: 7px !important;
        padding: 7px 10px !important;
    }

    .modern-navbar .modern-brand {
        font-size: 17px !important;
    }

    .modern-navbar .brand-icon {
        font-size: 21px !important;
    }

    .modern-navbar .navbar-toggler {
        padding: 5px 8px !important;
    }
}
.gladwin-logo {
    display: block !important;
    height: 45px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain !important;
}

.modern-brand {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    width: auto !important;
    max-width: none !important;
}

/* =========================================
   MOBILE PRODUCT GRID - 2 PRODUCTS PER ROW
========================================= */

@media (max-width: 768px) {

    /* Force product grid to show 2 cards per row */
    body.bg-light .col-xl-10.col-lg-9.col-md-9 .row.row-cols-xl-4 > * {
        width: 50% !important;
        flex: 0 0 50% !important;
    }

    /* Make cards fit nicely in the smaller columns */
    .product-card .card-body {
        padding: 8px !important;
    }

    /* Smaller image area for mobile */
    .product-image-box {
        height: 125px !important;
        padding: 6px !important;
    }

    .product-image {
        height: 115px !important;
    }

    /* Smaller product text */
    .product-card h6 {
        font-size: 12px !important;
        line-height: 1.3 !important;
        min-height: 32px !important;
    }

    .product-card .fw-bold.fs-5 {
        font-size: 15px !important;
    }

    .product-card .small.text-muted {
        font-size: 10px !important;
    }

    /* Keep ADD button compact */
    .add-product-btn {
        width: 55px !important;
        min-width: 55px !important;
        height: 32px !important;
        font-size: 11px !important;
    }
    /* User Management should look like a normal navbar link */
    .modern-navbar .nav-user-management {
        background: transparent !important;
        border: none !important;
        color: #1e293b !important;
        padding: 10px 15px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-weight: 650 !important;
    }

    .modern-navbar .nav-user-management:hover {
        color: #4f46e5 !important;
        background: linear-gradient(135deg, #eef2ff, #e0f2fe) !important;

    }



}