:root {
    --color-red: #820000;
    --color-blue: #161773;
    --color-yellow: #ecb611;
    --color-white: #ffffff;
    --color-gray-light: #f8f9fa;
    --color-text-dark: #1f2937;
    --font-primary: 'Poppins', 'Segoe UI', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
}

body {
    font-family: var(--font-primary);
    background-color: #f3f4f6;
    color: var(--color-text-dark);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--color-blue);
}

/* Brand Colors & Utils */
.bg-brand-red {
    background-color: var(--color-red) !important;
    color: white;
}

.bg-brand-blue {
    background-color: var(--color-blue) !important;
    color: white;
}

.bg-brand-yellow {
    background-color: var(--color-yellow) !important;
    color: var(--color-blue);
}

.text-brand-red {
    color: var(--color-red) !important;
}

.text-brand-blue {
    color: var(--color-blue) !important;
}

.text-brand-yellow {
    color: var(--color-yellow) !important;
}

.text-shadow-sm {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Buttons - Premium Feel */
.btn {
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-brand-red {
    background-color: var(--color-red);
    color: white;
    border: 2px solid var(--color-red);
    box-shadow: 0 4px 6px rgba(130, 0, 0, 0.3);
}

.btn-brand-red:hover {
    background-color: white;
    color: var(--color-red) !important;
    transform: translateY(-2px);
}

.btn-brand-red:hover i,
.btn-brand-red:hover span.badge {
    color: var(--color-red) !important;
}

.btn-brand-red:active {
    background-color: var(--color-red) !important;
    color: white !important;
}

/* Custom Desktop Cart Animation */
/* Custom Desktop Cart Animation */
@media (min-width: 992px) {
    .mobile-action-bar .btn-brand-red:hover {
        background-color: var(--color-blue) !important;
        border-color: var(--color-blue) !important;
        color: white !important;
    }

    .mobile-action-bar .btn-brand-red:hover i,
    .mobile-action-bar .btn-brand-red:hover span.badge {
        color: white !important;
    }

    .nav-item:hover .btn-brand-red i.fa-shopping-basket {
        animation: desktop-cart-bounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    }
}

@keyframes desktop-cart-bounce {
    0% {
        transform: scale(1) rotate(0deg);
    }

    15% {
        transform: scale(1.2) rotate(-15deg);
    }

    30% {
        transform: scale(1.3) rotate(10deg);
    }

    45% {
        transform: scale(1.1) rotate(-8deg);
    }

    60% {
        transform: scale(1.2) rotate(5deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.btn-brand-yellow {
    background-color: var(--color-yellow);
    color: var(--color-blue);
    border: 2px solid var(--color-yellow);
    box-shadow: 0 4px 6px rgba(236, 182, 17, 0.3);
}

.btn-brand-yellow:hover {
    background-color: white;
    color: var(--color-blue);
    border-color: var(--color-blue);
    transform: translateY(-2px);
}

.btn-brand-blue {
    background-color: var(--color-blue);
    color: white;
    border: 2px solid var(--color-blue);
    box-shadow: 0 4px 6px rgba(22, 23, 115, 0.3);
}

.btn-brand-blue:hover {
    background-color: white;
    color: var(--color-blue);
    transform: translateY(-2px);
}

.btn-social {
    width: 40px;
    height: 40px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-social:hover {
    background-color: white;
    color: var(--color-blue) !important;
    transform: translateY(-3px);
}

.btn-social i {
    line-height: 0;
    vertical-align: middle;
}

/* Forms */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-sm);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 4px rgba(22, 23, 115, 0.1);
}

/* Unified Focus State for Input Groups */
.input-group,
.input-group .input-group-text,
.input-group .form-control {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(22, 23, 115, 0.1);
    border-radius: var(--radius-md);
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control {
    border-color: var(--color-blue);
}

.input-group .form-control:focus {
    box-shadow: none;
    /* Let the input-group handle the shadow */
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-blue);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: white;
    overflow: hidden;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #f3f4f6;
    padding: 1.5rem;
    font-weight: 700;
    color: var(--color-blue);
}

/* Product Cards */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-card img {
    height: 220px;
    object-fit: cover;
    border-bottom: 4px solid var(--color-yellow);
}

/* Navbar */
.navbar {
    box-shadow: var(--shadow-md);
}

/* Quantity Input Styling */
.quantity-input {
    text-align: center !important;
    -moz-appearance: textfield;
    /* Firefox */
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.nav-link {
    font-weight: 500;
}

/* Admin Specific */
/* Admin Specific */
.admin-sidebar {
    background-color: var(--color-white);
    border-right: 3px solid var(--color-red);
    color: var(--color-blue);
    min-height: 100vh;
    width: 280px;
}

.admin-sidebar .nav-link {
    color: var(--color-blue);
    padding: 0.65rem 1rem;
    border-radius: 0 50px 50px 0;
    margin-bottom: 2px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.admin-sidebar .nav-link i {
    width: 28px;
    text-align: center;
    font-size: 1.1rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--color-red);
    color: var(--color-white);
    border-left: 5px solid var(--color-blue);
}

.admin-sidebar .nav-link:hover i,
.admin-sidebar .nav-link.active i {
    color: var(--color-white) !important;
}

@media (max-width: 991.98px) {
    #adminSidebar.offcanvas-start {
        width: 100vw;
        border-right: none;
        z-index: 1060 !important;
        /* Fix text overlapping the sidebar */
    }

    .admin-sidebar {
        width: 100vw;
    }
}

.admin-content {
    background-color: #f3f4f6;
    min-height: 100vh;
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

@media (min-width: 992px) {
    .admin-content {
        margin-left: 280px;
    }

    .offcanvas-lg {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1045;
        visibility: visible;
    }
}

.stat-card {
    border-left: 5px solid var(--color-blue);
}

/* Admin Action Buttons */
.admin-action-btn {
    width: 35px;
    height: 35px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.admin-action-btn.btn-edit {
    background-color: #f8f9fa;
    color: var(--color-blue);
}

.admin-action-btn.btn-edit:hover {
    background-color: var(--color-blue);
    color: white;
}

.admin-action-btn.btn-delete {
    background-color: #fff0f0;
    color: var(--color-red);
}

.admin-action-btn.btn-delete:hover {
    background-color: var(--color-red);
    color: white;
}

/* Base Admin Table Improvements */
.table td {
    vertical-align: middle;
}

.table .admin-actions-cell {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

/* Enhanced Navbar Styles */
/* Font Script */
.font-script {
    font-family: 'Great Vibes', cursive;
}

/* Enhanced Navbar Styles */
.navbar-brand {
    position: relative;
    z-index: 1050;
}

.header-logo-container {
    height: 50px;
    width: auto;
    display: flex;
    align-items: center;
}

.logo-img {
    max-height: 100%;
    width: auto;
    transform: scale(1.6);
    transform-origin: left center;
    transition: transform 0.3s ease;
}



.navbar .nav-link {
    padding: 0.5rem 1rem !important;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

/* Hover Animation - Floating Pill */
.navbar .nav-link:hover,
.navbar .nav-link.active-menu-link {
    background-color: var(--color-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white !important;
}

/* Hover Dropdown */
@media (min-width: 992px) {
    .hover-dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }

    /* Bridge the gap so hover state isn't lost */
    .hover-dropdown .dropdown-menu::after {
        content: '';
        position: absolute;
        top: -30px;
        left: 0;
        right: 0;
        height: 30px;
        background: transparent;
    }
}

/* Custom Highlight Menus (Clube Q+ and Seasonal) */
.btn-clube {
    background-color: var(--color-red) !important;
    color: white !important;
    border-radius: 50px !important;
    padding: 0.4rem 1.2rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 6px rgba(130, 0, 0, 0.2) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clube:hover,
.btn-clube.active-clube {
    background-color: var(--color-blue) !important;
    color: white !important;
    box-shadow: 0 6px 12px rgba(22, 23, 115, 0.3) !important;
    transform: translateY(-2px);
}

.btn-clube.active-clube .text-brand-yellow,
.btn-clube:hover .text-brand-yellow {
    color: var(--color-yellow) !important;
}

.btn-seasonal {
    background: linear-gradient(45deg, var(--color-yellow), #ffda44) !important;
    color: var(--color-blue) !important;
    border-radius: 50px !important;
    padding: 0.4rem 1.2rem !important;
    font-weight: 700 !important;
    box-shadow: 0 0 10px rgba(236, 182, 17, 0.6) !important;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

.btn-seasonal:hover,
.btn-seasonal.active-seasonal {
    background: linear-gradient(45deg, var(--color-blue), #2a2db8) !important;
    color: white !important;
    border-color: var(--color-yellow) !important;
    box-shadow: 0 0 15px rgba(22, 23, 115, 0.6) !important;
    transform: translateY(-2px) scale(1.05);
    animation: none !important;
    /* Pare o pulso quando ativo/passar o mouse */
    text-shadow: none;
}

.btn-seasonal:hover i,
.btn-seasonal.active-seasonal i {
    color: var(--color-yellow) !important;
}

/* Button White - For Cart */
.btn-white {
    background-color: white !important;
    color: var(--color-red) !important;
    border: none;
}

.btn-white:hover {
    background-color: #f8f9fa !important;
    transform: translateY(-2px);
}

/* Underline Effect - Exclude Dropdown Toggle */
.hover-underline:not(.dropdown-toggle)::after {
    display: none;
    /* Disable old effect globally if present */
}

.hover-bg-white:hover {
    background-color: white !important;
    color: var(--color-red) !important;
}

.hover-text-red:hover {
    color: var(--color-red) !important;
}

.dropdown-item {
    font-weight: 500;
    color: var(--color-text-dark);
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(236, 182, 17, 0.15);
    /* Yellow tint */
    color: var(--color-red);
    transform: translateX(5px);
}

.filter-white {
    filter: brightness(0) invert(1);
}

/* Responsive Menu Adjustments */
@media (max-width: 991.98px) {
    .navbar-collapse .nav-menu-container {
        background-color: var(--color-red);
        border: 3px solid var(--color-blue);
        /* Borda azul solicitada */
        border-radius: var(--radius-lg);
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    }

    .navbar-collapse {
        /* These styles were moved to .navbar-collapse .nav-menu-container */
    }

    .navbar-collapse .navbar-nav {
        gap: 0.25rem !important;
    }

    .navbar-collapse .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 0.25rem;
        margin-bottom: 0.25rem;
        width: 100%;
    }

    .navbar-collapse .nav-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .navbar-collapse .nav-link {
        padding: 0.4rem 1rem !important;
        display: block;
        width: 100%;
        color: white !important;
        font-size: 0.85rem;
    }

    /* Ensure dropdowns look good in mobile menu */
    .navbar-collapse .dropdown-menu {
        background-color: white !important;
        border: none;
        margin-top: 0.5rem;
        display: none;
    }

    .navbar-collapse .dropdown-menu.show {
        background-color: white !important;
        border: none;
        margin-top: 0.5rem;
        padding: 0.25rem;
        border-radius: var(--radius-md);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 0;
        justify-items: center;
        align-items: center;
    }

    .navbar-collapse .dropdown-item {
        color: var(--color-blue) !important;
        padding: 0.5rem 0.25rem;
        margin: 0;
        font-size: 0.75rem;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center;
        gap: 0.25rem;
        width: 100%;
        height: 100%;
        border-radius: 8px;
        transition: all 0.2s ease;
    }

    .navbar-collapse .dropdown-item .rounded-circle {
        margin-right: 0 !important;
        width: 35px !important;
        height: 35px !important;
        padding: 0.15rem !important;
    }

    .navbar-collapse .dropdown-item .fas {
        font-size: 0.95rem;
    }

    .navbar-collapse .dropdown-item:hover {
        background-color: rgba(0, 0, 0, 0.05);

        color: white;
    }

    /* Mobile Action Bar overrides (Cart + Login) */
    .navbar-collapse .mobile-action-bar {
        background-color: transparent !important;
        margin-top: 0 !important;
        margin-bottom: 0.5rem !important;
        padding-top: 0.5rem !important;
        padding-bottom: 1rem !important;
        border: none !important;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    }

    .navbar-collapse .mobile-action-bar .nav-item {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
        width: auto !important;
    }

    /* Mobile Cart Icon Specific Hover */
    .mobile-action-bar .btn-brand-red:hover {
        background-color: var(--color-blue) !important;
        border-color: var(--color-blue) !important;
        color: white !important;
    }

    .mobile-action-bar .btn-brand-red:hover i,
    .mobile-action-bar .btn-brand-red:hover span.badge {
        color: white !important;
    }
}

/* Desktop Menu Adjustments */
@media (min-width: 992px) {
    .nav-menu-container .nav-link {
        font-size: 0.95rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .mobile-action-bar {
        position: relative;
        z-index: 1050;
        /* Normal z-index now since no overlap */
    }
}

/* Responsive Menu Adjustments */
@media (max-width: 991.98px) {

    /* Header Mobile Flex Layout - Natural Proportions */
    .mobile-header-flex {
        padding: 0.5rem 0 !important;
    }

    .mobile-header-flex .mobile-logo-img {
        max-width: 140px;
        /* Let the logo be a reasonable natural size */
        height: auto;
        object-fit: contain;
    }

    /* Hide Bootstrap's old expanding menu system in mobile, using overlay now */
    .navbar-collapse {
        display: none !important;
    }

    /* FULLSCREEN OVERLAY MENU */
    .fullscreen-menu-overlay {
        position: fixed;
        top: 0;
        /* Start from exactly the top of the screen */
        left: 0;
        width: 100vw;
        height: 100vh;
        /* Fill the entire screen */
        background-color: white;
        z-index: 1060;
        /* Higher than navbar (1050) so it covers the header */
        overflow-y: hidden;

        /* Animation Base */
        opacity: 0;
        visibility: hidden;
        clip-path: circle(0% at 37.5% 10%);
        /* Start hidden from approximately where the menu button is vertically */
        transition: all 0.4s cubic-bezier(0.86, 0, 0.07, 1);
    }

    /* Opened State */
    .fullscreen-menu-overlay.menu-active {
        opacity: 1;
        visibility: visible;
        clip-path: circle(150% at 37.5% 10%);
        /* Expand to full */
    }

    .fullscreen-menu-overlay .nav-link.active-mobile {
        background-color: var(--color-blue) !important;
        color: white !important;
    }

    /* Submenu Collapse Animation & Styling */
    .dropdown-toggle-mobile[aria-expanded="true"] i {
        transform: rotate(180deg);
    }

    .dropdown-toggle-mobile i {
        transition: transform 0.3s ease;
    }

    /* Adjust navbar z-index when menu is open so it sits on top for the close button */
    .navbar.menu-open-layer {
        z-index: 1070;
    }


    .navbar-collapse .navbar-nav {
        align-items: center !important;
    }

    .navbar-collapse .nav-item {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .navbar-collapse .nav-link {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .navbar-collapse .dropdown-menu {
        text-align: center;
        width: 100%;
    }

    .navbar-collapse .dropdown-item {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .navbar-collapse .btn-white {
        margin-left: auto;
        margin-right: auto;
    }

    /* Hamburger Menu Animation */
    .menu-toggle-btn {
        transition: all 0.3s ease-in-out;
    }

    .menu-toggle-btn i {
        transition: transform 0.3s ease-in-out;
    }

    .menu-toggle-btn:not(.collapsed) {
        background-color: var(--color-blue) !important;
        color: white !important;
        box-shadow: 0 4px 8px rgba(22, 23, 115, 0.3) !important;
    }

    .menu-toggle-btn:not(.collapsed) i {
        transform: rotate(90deg);
    }
}

/* Footer Centralization for Mobile */
@media (max-width: 767.98px) {
    footer {
        text-align: center !important;
    }

    footer .social-links {
        justify-content: center;
    }

    footer .list-unstyled.d-flex,
    footer .list-unstyled {
        align-items: center;
    }

    footer .col-lg-3 .d-flex {
        justify-content: center;
    }

    footer .d-flex {
        justify-content: center;
    }

    footer .text-start {
        text-align: center !important;
    }
}