/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Open+Sans:wght@400;600&display=swap');

body {
    font-family: 'Open Sans', Arial, sans-serif; /* Updated font */
    background-color: #F8F9FA; /* New: Very Light Gray */
    color: #212529; /* New: Dark Gray/Almost Black for primary text */
    margin: 0;
    line-height: 1.6; /* Adjusted for better readability */
    font-size: 16px; /* Standard base font-size */
    -webkit-font-smoothing: antialiased; /* Smoother fonts on WebKit */
    -moz-osx-font-smoothing: grayscale; /* Smoother fonts on Firefox */
    display: grid;
    grid-template-rows: auto auto 1fr auto; /* Header, Banner, Main (stretches), Footer */
    min-height: 100vh;
    position: relative; /* Ensures proper positioning context */
}

.container {
    width: 100%;
    max-width: 1320px; /* Slightly increased max-width for modern layouts */
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px; /* Consistent padding */
    padding-right: 20px; /* Consistent padding */
    box-sizing: border-box;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif; /* Updated font for headings */
    color: #212529; /* Consistent dark color for headings */
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 600; /* Slightly bolder for headings */
    line-height: 1.3;
}

h1 { 
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
}

h2 { 
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    line-height: 1.3;
}

h3 { 
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    line-height: 1.3;
}

h4 { 
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.4;
}

h5 { 
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.4;
}

h6 { 
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.4;
}

p {
    margin-bottom: 1.2em;
    color: #343A40; /* Slightly lighter than primary text for body copy */
}

a {
    color: #007BFF; /* New: Vibrant Blue for links */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #0056b3; /* Darker blue on hover */
    text-decoration: underline;
}

/* Site Header Styles (Consolidated) */
/* Styles for .site-header, .site-header__branding, .site-header__logo, 
   .site-header__title a are now primarily in ninhomix-custom.css 
   or handled by Bootstrap navbar classes. */

/* Remove or comment out old .site-header specific rules if they are now in ninhomix-custom.css or handled by Bootstrap */

/* .site-header {
    background-color: #FFFFFF;
    padding: 1em 0; 
    border-bottom: 1px solid #DEE2E6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    grid-row: 1 / 2; 
}

.site-header .container {
    display: flex;
    justify-content: space-between; 
    align-items: center;
}

.site-header__branding {
    display: flex;
    align-items: center;
    flex-grow: 1; 
}

.site-header__logo {
    height: 180px; 
    width: 180px;  
    border-radius: 50%;
    background-color: #ddd;
    margin-right: 30px; 
    object-fit: cover;
    transition: height 0.3s ease, width 0.3s ease; 
}

.site-header__title a {
    font-size: 1.5rem; 
    transition: font-size 0.3s ease; 
}

.site-header__nav {
    display: flex;
    align-items: center;
}

.site-header__nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-header__nav ul li {
    margin-left: 20px; 
}

.site-header__nav ul li a {
    padding: 0.8em 1em; 
    font-size: 0.9rem; 
    color: #007BFF; 
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.site-header__nav ul li a:hover {
    color: #0056b3; 
    text-decoration: underline;
}

.site-header__nav-toggle {
    display: none; 
    background: none;
    border: none;
    color: #007BFF; 
    font-size: 1.5rem; 
    cursor: pointer;
    padding: 0.5rem; 
} */

/* Hero Banner Section - MOVIDO PARA ninhomix-custom.css */

/* Homepage Main Layout */
.homepage-main-layout {
    margin-top: 20px;
    position: relative;
    padding-top: 60px; /* Space for the absolute positioned dropdown area */
    display: flow-root; /* ADDED: To properly contain children and expand height naturally */
}

.categories-dropdown-area {
    position: absolute; 
    left: 0;            
    top: 10px;             /* CHANGED - Position within the parent's padding-top */
    width: 250px; 
    z-index: 50; /* Increased z-index */
}

.categories-dropdown-toggle-btn {
    background-color: #FFFFFF;
    color: #007BFF;
    border: 1px solid #DEE2E6;
    padding: 10px 15px;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.categories-dropdown-toggle-btn .dropdown-arrow {
    transition: transform 0.3s ease;
}

.categories-dropdown-toggle-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.categories-dropdown-menu {
    display: none; 
    position: absolute;
    top: 100%; 
    left: 0;
    width: 400px; /* Increased width from 350px to 400px for more overlap */
    background-color: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-top: none; 
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-height: 300px; 
    overflow-y: auto;
    z-index: 100; /* Ensure dropdown is above other content in the layout */
}

.categories-dropdown-menu.open {
    display: block;
}

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

.category-filter-list li a {
    display: block;
    padding: 10px 15px;
    color: #343A40;
    text-decoration: none;
    border-bottom: 1px solid #F1F3F5;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.category-filter-list li:last-child a {
    border-bottom: none;
}

.category-filter-list li a:hover,
.category-filter-list li.active a {
    background-color: #007BFF;
    color: #FFFFFF;
}

.homepage-content-area {
    /* flex: 1; */ /* REMOVED */
    min-width: 0; /* May not be strictly necessary anymore */
}


/* Main Content Area */
main.container { /* Ensure main also respects container padding */
    padding-top: 20px;
    padding-bottom: 20px;
    grid-row: 3 / 4; /* Main content row (stretchy) */
    display: block; 
    /* overflow: auto; REMOVED */
}

/* Search Results Page Specific Styles */
.search-results-page {
    min-height: 70vh; /* Ensures minimum height to push footer down */
    margin-bottom: 2rem; /* Add space before the footer */
}

/* Ensure the body of search results page uses grid layout properly */
.search-results-body {
    display: grid;
    grid-template-rows: auto auto 1fr auto; /* Header, Banner, Main (stretches), Footer */
    min-height: 100vh;
    position: relative;
}

/* Product Grid / Cards */
.product-card {
    background-color: #FFFFFF;
    border: 1px solid #DEE2E6; /* New: Light Gray border */
    border-radius: 8px; /* Consistent rounded corners */
    padding: calc(15px * 0.85); /* Reduced padding by 15% */
    text-align: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure cards in a row have same height if needed by grid */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Subtle default shadow */
    min-width: 0; /* Permite que o card encolha */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.product-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1); /* Enhanced shadow on hover */
    transform: translateY(-4px); /* Lift effect on hover */
}

/* New class for consistent image container sizing */
.product-card__image-container {
    width: 100%;
    /* Original aspect ratio 1:1 (square) -> padding-top: 100%; */
    /* Reduzindo a altura em 15% -> 100% * 0.85 = 85% */
    padding-top: 85%; 
    position: relative;
    overflow: hidden;
    border-radius: calc(6px * 0.85); 
    margin-bottom: calc(12px * 0.85); 
    background-color: transparent; /* Changed from #f0f0f0 */
}

.product-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Garante que toda a imagem seja visível, pode deixar espaços */
    transition: transform 0.3s ease; /* For subtle zoom effect on card hover */
}

.product-card:hover .product-card__image {
    transform: scale(1.05); /* Subtle zoom on image */
}

/* ADDED FOR CATEGORY PAGE SPECIFICALLY TO AVOID CONFLICTS */
/* REMOVED REDUNDANT RULE:
.category-page .product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); 
    gap: 10px;
}
*/
/* END ADDED FOR CATEGORY PAGE */


.product-card .product-card__name { /* Changed from .product-card h3 */
    font-size: calc(1.1rem * 0.85); /* Reduced font-size by 15% */
    margin: calc(12px * 0.85) 0 calc(8px * 0.85) 0; /* Adjusted margin */
    color: #212529; /* Dark heading color */
    line-height: 1.4; /* Added for better text flow in smaller cards */
    height: 2.6em; /* Approx 2 lines of text, adjust as needed - this might need tweaking after font size change */
    overflow: hidden; /* Hide overflow text */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    line-clamp: 2; /* Standard property */
    -webkit-box-orient: vertical;
}

.product-card .product-price {
    font-size: calc(1.15rem * 0.85); /* Reduced font-size by 15% */
    color: #007BFF; /* New: Accent Blue for price */
    font-weight: 700; /* Bolder price */
    margin: calc(8px * 0.85) 0 calc(12px * 0.85) 0; /* Adjusted margin */
}

.product-card .btn {
    margin-top: auto; /* Pushes button to the bottom */
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: #007BFF; /* New: Vibrant Blue */
    color: #FFFFFF;
    padding: 12px 28px; /* Slightly adjusted padding */
    border-radius: 6px; /* Consistent border-radius */
    text-decoration: none;
    font-weight: 600; /* Bolder button text */
    font-size: 1rem;
    border: 1px solid transparent; /* Added border for consistency, can be colored for outline buttons */
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.07); /* Subtle shadow for buttons */
}

.btn:hover {
    background-color: #0056b3; /* Darker blue */
    border-color: #0056b3;
    color: #FFFFFF;
    text-decoration: none;
    transform: translateY(-1px); /* Subtle lift effect */
}

.btn:active {
    transform: translateY(0px); /* Press effect */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}


.btn-secondary {
    background-color: #6C757D; /* New: Medium Gray */
    color: #FFFFFF;
    border-color: #6C757D;
}

.btn-secondary:hover {
    background-color: #5A6268; /* Darker Gray */
    border-color: #545B62;
    color: #FFFFFF;
}


/* Featured Products Section */
.featured-products-section {
    background-color: transparent; /* Remove distinct background, rely on page background */
    padding: 30px 0; /* Adjusted padding, no side padding as container handles it */
    border-radius: 0; /* Remove border-radius */
    box-shadow: none; /* Remove box-shadow */
    margin-bottom: 30px;
}

/* Base product grid layout */
.product-grid {
    display: grid;
    gap: 15px;
    width: 100%;
    padding: 0 clamp(5px, 2vw, 20px);
}

/* Sistema de breakpoints precisos */

/* Mobile Extra Small (até 400px) - FORÇA 1 coluna */
@media (max-width: 400px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 10px;
        max-width: 100%;
    }

    .product-card {
        max-width: 100%;
        margin: 0 auto;
    }
}

/* Mobile Small (401px - 575px) - 1 coluna flexível */
@media (min-width: 401px) and (max-width: 575px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
        padding: 0 15px;
        max-width: 100%;
    }
}

/* Tablet Small (576px - 767px) - 2 colunas */
@media (min-width: 576px) and (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 15px;
        max-width: 100%;
    }
}

/* Tablet Medium (768px - 991px) - 3 colunas */
@media (min-width: 768px) and (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 0 20px;
        max-width: 100%;
    }
}

/* Desktop Small (992px - 1199px) - 4 colunas */
@media (min-width: 992px) and (max-width: 1199px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        padding: 0 20px;
        max-width: 1140px;
        margin: 0 auto;
    }
}

/* Desktop Medium (1200px - 1399px) - 4 colunas com espaçamento maior */
@media (min-width: 1200px) and (max-width: 1399px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
        padding: 0 30px;
        max-width: 1320px;
        margin: 0 auto;
    }
}

/* Desktop Large (1400px+) - 4 colunas com margens laterais para evitar esticamento */
@media (min-width: 1400px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
        padding: 0 clamp(40px, 8vw, 120px);
        max-width: 1600px;
        margin: 0 auto;
    }
}

/* Garantir responsividade dos cards */
.product-card {
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.product-card .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card .card-text.flex-grow-1 {
    flex-grow: 1;
}

/* Ajustes específicos para imagens dos produtos */
.product-card .card-img-top {
    width: 100%;
    height: clamp(180px, 25vw, 220px);
    object-fit: contain;
    padding: 0.8rem;
    background: #f8f9fa;
}

/* Responsividade das imagens por breakpoint */
@media (max-width: 575px) {
    .product-card .card-img-top {
        height: 160px;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .product-card .card-img-top {
        height: 180px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .product-card .card-img-top {
        height: 190px;
    }
}

@media (min-width: 992px) {
    .product-card .card-img-top {
        height: 200px;
    }
}

/* Footer */
.site-footer, footer { /* Support both .site-footer and regular footer element */
    background-color: #343A40; /* Darker background for footer */
    color: #F8F9FA; /* Light text on dark background */
    padding: 1.5em 0; /* Base padding */
    text-align: center;
    font-size: 0.875rem; /* Base font size for footer */
    grid-row: 4 / 5; /* CHANGED: Footer row */
    width: 100%;
    margin-top: auto; /* Push footer to the bottom when using flexbox */
    position: relative; /* Ensure proper positioning */
    z-index: 1; /* Lower z-index to not interfere with navbar */
}

/* Ensure footer is properly positioned in search results page */
.search-results-page + footer {
    margin-top: 2rem;
    position: relative;
    z-index: 10;
}

.site-footer .container p {
    margin-bottom: 0.5em; /* Adjust spacing within footer */
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(10px, 2vw, 40px);
    padding-right: clamp(10px, 2vw, 40px);
}

.site-footer a {
    color: #ADB5BD; /* Lighter link color for dark background */
}

.site-footer a:hover {
    color: #FFFFFF;
}

.footer-copyright {
    margin-bottom: 10px; /* Space between copyright and links on mobile */
}

.footer-links {
    display: inline-block; /* Keep links on one line if space allows */
}

.footer-link-separator {
    margin: 0 5px;
}

/* Responsive Footer */
@media (min-width: 768px) {
    .site-footer .container > p { /* Made selector more specific to the p inside footer's container */
        display: flex; /* ADDED: Explicitly set display to flex */
        flex-direction: row; /* Arrange items in a row on larger screens */
        justify-content: space-between; /* Space out copyright and links */
        align-items: center; /* ADDED: Vertically align items if they have different heights */
    }

    .footer-copyright {
        margin-bottom: 0; /* Remove bottom margin */
    }

    .footer-links {
        text-align: right; /* Align links to the right */
    }
}


/* Styles for the main product page layout */
#product-detail-layout-container {
    display: flex;
    align-items: flex-start; /* Align items to the top */
    gap: 30px; /* Space between image and info columns */
    padding-top: 20px;
    padding-bottom: 20px;
}

/* Styles for product image column on product detail page */
.product-image-column {
    flex: 0 0 40%;
    max-width: 40%;
    position: relative; 
    max-height: 450px; /* Mantém uma altura máxima para a coluna no desktop */
    display: flex;
    align-items: flex-start; /* Align image to the top of this column */
    justify-content: center;/* Centraliza horizontalmente se a imagem for menor que a coluna */
}

.product-detail-main-image {
    width: auto;   
    height: auto;  
    max-width: 100%;   
    max-height: 100%; 
    object-fit: contain; 
    border-radius: 8px;
    background-color: #f8f9fa; 
    border: 1px solid #DEE2E6; 
    display: block; 
}

/* Styles for product information column on product detail page */
.product-info-column {
    flex: 1; /* Info column takes the remaining available space */
    min-width: 0; /* Important for flex items: prevents content from causing overflow if too wide */
}

/* ADDED: Style for the main product name (H1) on product detail page */
.product-name-main {
    margin-top: 0; /* Align top of title with top of its container */
    /* Default h1 bottom margin should still apply, or can be adjusted here if needed */
}

/* Styles for individual info cards within the product-info-column */
.product-info-card {
    background-color: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.product-info-card:last-child {
    margin-bottom: 0;
}

.product-info-card h4 { /* Styling for titles within info cards */
    font-size: 1.2rem; 
    margin-top: 0;
    margin-bottom: 15px; /* Increased margin for better spacing */
    color: #343A40;
}

/* Affiliate Buttons Styling */
.affiliate-links-main .affiliate-buttons-container {
    display: flex;
    flex-wrap: wrap; 
    gap: 8px /* Reduced gap */;
    align-items: center; 
}

.button--affiliate {
    flex-grow: 1; 
    flex-basis: calc(50% - 4px); /* Adjust basis for new gap */
    text-align: center;
    padding: 8px 12px; /* Reduced padding */
    font-size: 0.85rem; /* Reduced font size */
    /* Specific store button styles are already defined (amazon, mercadolivre, etc.) */
    white-space: nowrap; /* Prevent text from wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for long text */
    min-width: 120px; /* Add a min-width to prevent them from becoming too small */
}

/* Ensure on very small screens, if not covered by the main @media (max-width: 768px) rule, they stack */
@media (max-width: 480px) {
    .button--affiliate {
        flex-basis: 100%; /* Each button takes full width */
        font-size: 0.85rem; /* Adjust if needed for very small screens */
        padding: 8px 10px; /* Adjust padding */
    }
}


/* Styles for the product technical details section */
.product-technical-details {
    background-color: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.product-technical-details h3 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1em;
    color: #212529;
}

.product-technical-details dt {
    font-weight: 500;
    color: #495057;
}

.product-technical-details dd {
    margin-bottom: 1em;
    margin-left: 0;
    color: #343A40;
    padding-left: 1.2em;
    text-indent: -1.2em;
}

.product-technical-details dd:before {
    content: "• "; /* Bullet point */
    color: #007BFF; /* Accent color for bullets */
    font-weight: 700;
    display: inline-block;
    width: 1em; /* Align bullet with text */
    margin-left: -1.2em; /* Pull bullet to the left */
}

.product-technical-details .btn {
    margin-top: 1em;
    display: inline-block;
}

/* Quick View Styles */
.quick-view-modal {
    max-width: 90%;
    width: 600px;
    background-color: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    margin: 0 auto;
}

.quick-view-modal h2 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 1em;
    color: #212529;
}

.quick-view-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: transparent;
    border: none;
    font-size: 1.5rem;
    color: #495057;
    cursor: pointer;
}

.quick-view-modal .close-btn:hover {
    color: #007BFF;
}

.quick-view-modal img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1em;
}

.quick-view-modal .product-price {
    font-size: 1.5rem;
    color: #007BFF;
    font-weight: 700;
    margin-bottom: 1em;
}

.quick-view-modal .btn {
    width: 100%;
    margin-top: 1em;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  body {
    -webkit-print-color-adjust: exact; /* Ensure background colors are printed */
    print-color-adjust: exact;
  }

  .site-header, .site-footer, .btn, .product-card {
    display: none !important; /* Hide header, footer, buttons, and product cards */
  }

  .product-detail-container {
    display: block !important;
    page-break-inside: avoid;
  }

  .product-detail-container * {
    display: block;
    page-break-inside: avoid;
  }

  .product-detail-container img {
    max-width: 100% !important;
    height: auto !important;
  }

  .product-detail-container h1,
  .product-detail-container h2,
  .product-detail-container h3,
  .product-detail-container h4,
  .product-detail-container h5,
  .product-detail-container h6 {
    page-break-after: avoid;
  }

  .product-detail-container p,
  .product-detail-container ul,
  .product-detail-container ol {
    page-break-inside: avoid;
  }

  /* Hide elements that should not appear in print */
  .no-print {
    display: none !important;
  }
}

/* ==========================================================================
   Responsive Header Styles
   ========================================================================== */

/* Responsive Header */
@media (max-width: 768px) {
    /* Header Navigation */
    .site-header .container {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .site-header__nav {
        display: none; /* Hide nav by default on mobile */
        position: absolute;
        top: 100%; /* Position abaixo do cabeçalho */
        left: 0;
        right: 0;
        background-color: #FFFFFF;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 999; /* Ensure it's above other content */
        padding: 10px 0; /* Add some padding */
    }

    .site-header__nav.is-active {
        display: block; /* Show nav when active */
    }

    .site-header__nav ul {
        flex-direction: column; /* Stack nav items vertically */
        align-items: center; /* Center items */
    }

    .site-header__nav li {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    .site-header__nav a {
        display: block; /* Make links take full width */
        padding: 12px 20px; /* Adjust padding for touch targets */
        border-bottom: 1px solid #F1F3F5; /* Separator for nav items */
    }
    
    .site-header__nav li:last-child a {
        border-bottom: none;
    }

    .site-header__nav-toggle {
        display: block; /* Show hamburger button on mobile */
    }

    /* Site Header Layout */
    .site-header {
        padding: 0.5em 0;
    }
    
    .site-header__branding {
        flex-grow: 0;
    }
    
    .site-header__logo {
        height: 50px;
        width: 50px;
        margin-right: 12px;
    }

    /* Hero Banner */
    .hero-banner-section .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Mobile overflow fixes */
    body, html {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .container, .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .site-header, .navbar {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Store Price Responsive Styles */
    .best-price-badge {
        display: block;
        margin-left: 0;
        margin-top: 5px;
        text-align: center;
    }
    
    .store-price {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .store-price-value {
        margin-top: 2px;
    }
    
    .best-price-tag {
        margin-top: 3px;
    }
}

@media (max-width: 992px) {
    .site-header__logo {
        height: 60px; /* Reduced from 150px to reasonable size */
        width: 60px;  /* Reduced from 150px to reasonable size */
    }
    .site-header__title a {
        font-size: 1.3rem;
    }
    .site-header__nav ul li a {
        font-size: 0.85rem;
        padding: 0.7em 0.9em;
    }
}



@media (max-width: 540px) {
    .site-header__logo {
        height: 45px; /* Reduced from 120px to reasonable small mobile size */
        width: 45px;  /* Reduced from 120px to reasonable small mobile size */
    }

    .hero-banner-section .container {
        padding-left: 5px; /* Further reduced padding for small mobile */
        padding-right: 5px; /* Further reduced padding for small mobile */
    }
}

@media (max-width: 767px) {
    .carousel-item-container {
        min-height: 300px;
    }
    
    .carousel-product:not(.center) {
        display: none;
    }
    
    .carousel-product.center {
        width: 80%;
        max-width: 280px;
    }
    
    /* Pagination adjustments for small screens */
    .page-link {
        min-width: 32px;
        min-height: 32px;
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Carousel Animation Enhancements - Firebase Optimized */
/* Comentado para evitar conflitos - usando CSS específico em ninhomix-custom.css
.carousel-item {
    transition: transform 0.6s ease-in-out !important;
    -webkit-transition: -webkit-transform 0.6s ease-in-out !important;
    -moz-transition: -moz-transform 0.6s ease-in-out !important;
    -o-transition: -o-transform 0.6s ease-in-out !important;
    -ms-transition: -ms-transform 0.6s ease-in-out !important;
    
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    -moz-backface-visibility: visible !important;
    
    perspective: 1000px !important;
    -webkit-perspective: 1000px !important;
    -moz-perspective: 1000px !important;
    
    will-change: transform;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transform-origin: center center;
    -webkit-transform-origin: center center;
}

.carousel-item-next:not(.carousel-item-start),
.active.carousel-item-end {
    transform: translateX(100%) !important;
    -webkit-transform: translateX(100%) !important;
    -moz-transform: translateX(100%) !important;
    -ms-transform: translateX(100%) !important;
    opacity: 1 !important;
}

.carousel-item-prev:not(.carousel-item-end),
.active.carousel-item-start {
    transform: translateX(-100%) !important;
    -webkit-transform: translateX(-100%) !important;
    -moz-transform: translateX(-100%) !important;
    -ms-transform: translateX(-100%) !important;
    opacity: 1 !important;
}
*/

/* Carousel Layout Fixes - comentado para usar configuração específica
.carousel-item-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 1rem 0;
    min-height: 400px;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    box-sizing: border-box;
}
*/

.carousel-inner {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

#productCarousel {
    position: relative;
    overflow: hidden;
}

.carousel-container {
    max-width: 100%;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
}

/* Carrossel Navigation */
.carousel-control-prev,
.carousel-control-next {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
}

.carousel-control-prev {
    left: 10px;
}

.carousel-control-next {
    right: 10px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 1;
}

/* Social Icons Styling */
.social-icon-link {
    color: #333;
    background-color: #f8f9fa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.social-icon-link:hover {
    color: #fff;
    background-color: #0275d8;
    transform: translateY(-3px);
}

.social-icon-link-dark {
    color: #fff;
    background-color: #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid #fff;
}

.social-icon-link-dark:hover {
    color: #333;
    background-color: #fff;
    transform: translateY(-3px);
}

/* Estilos para exibição de preços por loja na página de detalhes do produto */
.best-price-badge {
    display: inline-block;
    background-color: #28a745;
    color: white;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
    font-weight: 500;
}

.all-store-prices {
    margin-top: 15px;
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
}

.all-store-prices h5 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
    color: #495057;
}

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

.store-price {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 5px;
    border-radius: 4px;
}

.store-price:hover {
    background-color: #f8f9fa;
}

.best-store-price {
    background-color: #f0fff4;
    border-left: 3px solid #28a745;
}

.store-name {
    flex: 1;
    font-weight: 500;
}

.store-price-value {
    font-weight: 600;
    margin-right: 10px;
}

.best-price-tag {
    background-color: #28a745;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 8px;
}



/* Responsive Header Styles */
/* Bootstrap handles the collapsing and toggler display. 
   Customizations below are for specific NinhoMixStore styling. */

.navbar-brand .site-header__logo {
    height: 50px; /* Adjusted for navbar */
    width: 50px;  /* Adjusted for navbar */
    /* margin-right: 10px; /* Bootstrap's .me-2 on logo or .ms-2 on title handles spacing */
}

.navbar-brand .site-header__title-text {
    font-size: 1.25rem; /* Adjusted for navbar */
    font-weight: 600;
    color: #212529;
}

.navbar-toggler.site-header__nav-toggle {
    border: none;
    color: #007BFF;
}
.navbar-toggler.site-header__nav-toggle:focus {
    box-shadow: none;
}

/* Styles for when the navbar is collapsed (mobile/tablet) */
@media (max-width: 991.98px) { /* Bootstrap's lg breakpoint */
    .navbar-collapse.site-header__nav-collapse {
        background-color: #fff; /* White background for collapsed menu */
        padding: 1rem; /* Padding inside collapsed menu */
        margin-top: 0.5rem; /* Space between toggler and collapsed menu */
        border-top: 1px solid #DEE2E6;
        box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    }

    .navbar-nav.site-header__menu {
        align-items: flex-start;
    }

    .navbar-nav.site-header__menu .nav-item {
        width: 100%;
    }

    .navbar-nav.site-header__menu .nav-item .nav-link {
        padding: 0.75rem 0; /* Adjust padding for vertical layout */
        /* border-bottom: 1px solid #f0f0f0; /* Optional separator */
    }
    /* .navbar-nav.site-header__menu .nav-item:last-child .nav-link {
        border-bottom: none;
    } */

    .site-header__search {
        margin-top: 1rem; /* Space above search bar in collapsed menu */
        width: 100%;
    }
}


/* Remove or adjust old responsive header styles if they conflict */
/* @media (max-width: 768px) { */
    /* .site-header .container {
        justify-content: space-between;
    } */

    /* .site-header__nav {
        display: none; 
        position: absolute;
        top: 100%; 
        left: 0;
        right: 0;
        background-color: #FFFFFF;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 999; 
        padding: 10px 0; 
    } */

    /* .site-header__nav.is-active {
        display: block; 
    } */

    /* .site-header__nav ul {
        flex-direction: column; 
        align-items: center; 
    } */
/* ...rest of the old responsive styles to be removed or adapted... */
/* } */

/* Global mobile overflow fixes */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Prevent any element from exceeding viewport width */
*, *::before, *::after {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Force container responsiveness */
.container, .container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Additional Mobile Layout Fixes */
@media (max-width: 768px) {
    .navbar-brand {
        max-width: 70% !important;
        overflow: hidden !important;
    }
    
    .site-header__title-text {
        font-size: clamp(1rem, 4vw, 1.25rem) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* Banner adjustments */
    .hero-banner-section {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    .hero-banner-placeholder {
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    .hero-banner__image {
        max-width: 100% !important;
        height: auto !important;
        width: auto !important;
    }
    
    /* Product grid mobile fixes */
    .product-grid {
        margin: 0 !important;
        padding: 0 5px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Product cards mobile fixes */
    .product-card {
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 0 1rem 0 !important;
        box-sizing: border-box !important;
    }
    
    .card-title, .product-card__name {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
    }
    
    /* Dropdown fixes */
    .categories-dropdown-area {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px !important;
        margin-bottom: 1rem !important;
    }
    
    .categories-dropdown-menu {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* Button fixes */
    .btn {
        max-width: 100% !important;
        word-wrap: break-word !important;
        white-space: normal !important;
    }
    
    /* Forms and inputs */
    .form-control, .site-header__search-input {
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    /* Footer fixes */
    .site-footer {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    .footer-links {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
}

@media (max-width: 480px) {
    /* Extra small devices - more aggressive fixes */
    .container, .container-fluid {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 0 !important;
    }
    
    .navbar-brand {
        max-width: 60% !important;
    }
    
    .site-header__title-text {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem) !important;
    }
    
    /* Homepage layout adjustments */
    .homepage-main-layout {
        padding-top: 10px !important;
    }
}

/* Critical fixes for layout issues */

/* Ensure navbar stays on top with highest z-index */
.navbar, .site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1050 !important; /* Higher than Bootstrap modal backdrop */
    background-color: #ffffff !important;
}

/* Ensure footer stays at bottom with lower z-index */
.site-footer, footer {
    position: relative !important;
    z-index: 1 !important;
    margin-top: auto !important;
}

/* Fix body layout to prevent footer overlap */
body {
    position: relative !important;
    z-index: 0 !important;
}

/* Carousel container fixes */
.featured-products-section {
    position: relative !important;
    z-index: 10 !important;
    overflow: hidden !important;
}

.slider {
    position: relative !important;
    overflow: hidden !important;
    z-index: 1 !important;
}

/* Force single slide display in carousel */
.slider-content {
    display: flex !important;
    overflow: hidden !important;
    position: relative !important;
}

.slider-content .slide {
    flex: 0 0 auto !important;
    min-width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

/* ========================================
   CLASSES DINÂMICAS PARA RESPONSIVIDADE AVANÇADA
   ======================================== */

/* Classes aplicadas dinamicamente pelo JavaScript */
.product-grid.grid-mobile-xs {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 0 5px !important;
}

.product-grid.grid-mobile-sm {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 10px !important;
    padding: 0 10px !important;
}

.product-grid.grid-tablet-sm {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 0 15px !important;
}

.product-grid.grid-tablet-md {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
    padding: 0 20px !important;
}

.product-grid.grid-desktop-sm {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 18px !important;
    padding: 0 25px !important;
    max-width: 1140px !important;
    margin: 0 auto !important;
}

.product-grid.grid-desktop-md {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    padding: 0 30px !important;
    max-width: 1320px !important;
    margin: 0 auto !important;
}

.product-grid.grid-desktop-lg {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    padding: 0 clamp(40px, 6vw, 80px) !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
}

/* ========================================
   SISTEMA DE ALINHAMENTO GLOBAL CONSISTENTE
   ======================================== */

/* Container principal para manter alinhamento consistente */
.main-content-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 clamp(10px, 2vw, 40px);
}

/* Aplicar alinhamento consistente a seções principais */
.hero-banner-section,
.featured-products-section,
.more-products-section,
.important-notice,
.homepage-main-layout {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(10px, 2vw, 40px);
    padding-right: clamp(10px, 2vw, 40px);
}

/* Alinhamento do dropdown de categorias */
.categories-dropdown-area {
    position: static; /* Mudança: remover posicionamento absoluto */
    width: 100%;
    max-width: 300px;
    margin-bottom: 20px;
    z-index: 50;
}

/* Ajustes responsivos para o dropdown */
@media (min-width: 992px) {
    .categories-dropdown-area {
        position: absolute;
        left: clamp(10px, 2vw, 40px);
        top: 10px;
        width: 250px;
    }
    
    .homepage-main-layout {
        padding-top: 60px;
    }
}

/* Alinhamento dos títulos de seção */
.section-title {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 clamp(10px, 2vw, 40px);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Alinhamento do aviso importante */
.important-notice {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 30px;
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsividade para telas muito pequenas */
@media (max-width: 400px) {
    .hero-banner-section,
    .featured-products-section,
    .more-products-section,
    .important-notice,
    .homepage-main-layout {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .categories-dropdown-area {
        max-width: 100%;
    }
}

/* ========================================
   TIPOGRAFIA RESPONSIVA USANDO CLAMP()
   ======================================== */

/* Títulos responsivos */
h1 { 
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
}

h2 { 
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    line-height: 1.3;
}

h3 { 
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    line-height: 1.3;
}

h4 { 
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.4;
}

h5 { 
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.4;
}

h6 { 
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.4;
}

/* Texto do corpo responsivo */
body {
    font-size: clamp(0.875rem, 2vw, 1rem);
    line-height: 1.6;
}

/* Títulos de seção específicos */
.section-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 600;
    text-align: center;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    color: #212529;
}

/* Título do site no header */
.site-header__title-text {
    font-size: clamp(1.1rem, 3vw, 1.5rem) !important;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Texto do aviso importante */
.important-notice {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    line-height: 1.5;
}

/* Títulos dos cards de produto */
.product-card .card-title,
.product-card .product-card__name {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    line-height: 1.4;
}

/* Preços dos produtos */
.product-card .product-price,
.product-card .card-text.fw-bold {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 700;
}

/* Descrições dos produtos */
.product-card .card-text.small {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    line-height: 1.4;
}

/* Botões responsivos */
.btn {
    font-size: clamp(0.85rem, 2.2vw, 1rem);
    padding: clamp(8px, 2vw, 12px) clamp(16px, 4vw, 28px);
}

/* Links do footer */
.site-footer {
    font-size: clamp(0.75rem, 1.8vw, 0.875rem);
}

/* Navegação do header */
.navbar-nav .nav-link {
    font-size: clamp(0.85rem, 2vw, 1rem);
}

/* Campo de busca */
.site-header__search .form-control {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* ========================================
   ESTILOS DE PAGINAÇÃO RESPONSIVOS
   ======================================== */

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: clamp(20px, 4vw, 40px);
    padding: 0 clamp(10px, 2vw, 40px);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(4px, 1vw, 8px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item {
    margin: 0;
}

.pagination .page-link {
    padding: clamp(6px, 1.5vw, 10px) clamp(10px, 2.5vw, 16px);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    border-radius: 6px;
    border: 1px solid #dee2e6;
    color: #007bff;
    text-decoration: none;
    background-color: #fff;
    transition: all 0.3s ease;
    min-width: clamp(32px, 6vw, 44px);
    text-align: center;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #0056b3;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
}

/* Responsividade para telas pequenas */
@media (max-width: 576px) {
    .pagination {
        gap: 2px;
    }
    
    .pagination .page-link {
        padding: 4px 8px;
        font-size: 0.75rem;
        min-width: 28px;
    }
    
    /* Ocultar alguns números de página em telas muito pequenas */
    .pagination .page-item:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) .page-link {
        display: none;
    }
}