/**
 * SCORTRIO Theme - Responsive Styles
 * @version 1.0.0
 */

/* ========================================
   BREAKPOINTS:
   - xs: 0
   - sm: 576px
   - md: 768px
   - lg: 992px
   - xl: 1200px
   - xxl: 1400px
======================================== */

/* ========================================
   MOBILE FIRST - BASE STYLES
======================================== */

/* Header Mobile */
.site-header .container {
    padding: 0 15px;
}

.site-branding {
    font-size: 1.25rem;
}

.main-navigation {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: var(--ec-bg-secondary);
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding: 80px 20px 20px;
}

.main-navigation.active {
    left: 0;
}

.main-navigation ul {
    flex-direction: column;
    gap: 0;
}

.main-navigation li {
    border-bottom: 1px solid var(--ec-border);
}

.main-navigation a {
    display: block;
    padding: 15px 0;
}

.main-navigation .sub-menu {
    position: static;
    display: none;
    background: transparent;
    box-shadow: none;
    padding-left: 20px;
}

.main-navigation .menu-item-has-children.open .sub-menu {
    display: block;
}

.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--ec-text);
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.menu-overlay.active {
    display: block;
}

/* Header Actions Mobile */
.header-actions {
    gap: 10px;
}

.search-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: var(--ec-bg-secondary);
    z-index: 1002;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.search-container.active {
    transform: translateY(0);
}

.search-toggle {
    display: flex;
}

/* Grid Mobile */
.modelos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.modelo-card {
    border-radius: 8px;
}

.card-image {
    aspect-ratio: 3/4;
}

.card-badges {
    gap: 5px;
}

.badge {
    font-size: 0.65rem;
    padding: 2px 6px;
}

.card-title {
    font-size: 0.875rem;
    padding: 8px;
}

/* Featured Slider Mobile */
.featured-slider .slider-wrapper {
    gap: 10px;
}

.featured-slider .slider-item {
    min-width: calc(50% - 5px);
}

/* Mini Slider Mobile */
.mini-slider-wrapper {
    gap: 10px;
    padding-bottom: 10px;
}

.mini-slider .mini-item {
    min-width: 80px;
    height: 100px;
}

/* Stories Mobile */
.stories-section {
    padding: 15px 0;
}

.stories-wrapper {
    gap: 10px;
    padding: 0 15px;
}

/* Story items - NÃO definir width/height fixo aqui, usar inline styles do front-page.php */
.story-item img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Section Titles Mobile */
.section-title {
    font-size: 1.25rem;
    padding: 0 15px;
}

.section-title span {
    font-size: 1.25rem;
}

/* Filter Sidebar Mobile */
.filters-sidebar {
    position: fixed !important;
    top: 0;
    right: -100%;
    width: 90%;
    max-width: 400px;
    height: 100vh;
    background: var(--ec-bg-card);
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.filters-sidebar.active {
    right: 0;
}

.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filters-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: var(--ec-bg-tertiary);
    border: none;
    border-radius: 4px;
    color: var(--ec-text);
    cursor: pointer;
}

/* Single Modelo Mobile */
.modelo-single-header {
    flex-direction: column;
}

.modelo-gallery {
    width: 100%;
}

.gallery-main {
    aspect-ratio: 3/4;
}

.gallery-thumbs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
}

.gallery-thumb {
    min-width: 60px;
    height: 60px;
}

.modelo-info {
    width: 100%;
    padding: 15px;
}

.modelo-name {
    font-size: 1.5rem;
}

.modelo-contact-btns {
    flex-direction: column;
}

.btn-whatsapp,
.btn-phone {
    width: 100%;
    justify-content: center;
}

.modelo-details-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Footer Mobile */
.footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
}

.footer-column h4 {
    margin-bottom: 15px;
}

.footer-column ul {
    columns: 2;
}

.footer-novidades .novidade-item {
    flex-direction: row;
    align-items: center;
}

.novidade-thumb {
    width: 50px;
    height: 50px;
}

.footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
}

/* Scroll to Top Mobile */
.scroll-to-top {
    bottom: 20px;
    right: 15px;
    width: 40px;
    height: 40px;
}

/* Lightbox Mobile */
.lightbox-content {
    width: 95%;
    max-height: 90vh;
}

.lightbox-prev,
.lightbox-next {
    width: 35px;
    height: 35px;
    font-size: 1.25rem;
}

/* ========================================
   SMALL DEVICES (576px and up)
======================================== */
@media (min-width: 576px) {
    .modelos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .featured-slider .slider-item {
        min-width: calc(50% - 10px);
    }

    .card-title {
        font-size: 1rem;
        padding: 10px;
    }

    .badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    /* Story items - manter visíveis no mobile */
    .story-item img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .gallery-thumb {
        min-width: 70px;
        height: 70px;
    }
}

/* ========================================
   MEDIUM DEVICES (768px and up)
======================================== */
@media (min-width: 768px) {
    .modelos-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .featured-slider .slider-item {
        min-width: calc(33.333% - 15px);
    }

    .modelo-single-header {
        flex-direction: row;
        gap: 30px;
    }

    .modelo-gallery {
        width: 50%;
    }

    .modelo-info {
        width: 50%;
    }

    .modelo-contact-btns {
        flex-direction: row;
    }

    .btn-whatsapp,
    .btn-phone {
        width: auto;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 1.5rem;
    }

    .mini-slider .mini-item {
        min-width: 100px;
        height: 120px;
    }
}

/* ========================================
   LARGE DEVICES (992px and up)
======================================== */
@media (min-width: 992px) {
    /* Header Desktop */
    .mobile-menu-toggle {
        display: none;
    }

    .menu-overlay {
        display: none !important;
    }

    .main-navigation {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        padding: 0;
        overflow: visible;
        transform: none;
    }

    .main-navigation ul {
        flex-direction: row;
        gap: 25px;
    }

    .main-navigation li {
        border: none;
    }

    .main-navigation a {
        padding: 10px 0;
    }

    .main-navigation .sub-menu {
        position: absolute;
        display: none;
        background: var(--ec-bg-secondary);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        padding: 10px 0;
        min-width: 200px;
        border-radius: 8px;
    }

    .main-navigation .menu-item-has-children:hover .sub-menu {
        display: block;
    }

    /* Search Desktop */
    .search-container {
        position: static;
        width: auto;
        padding: 0;
        background: transparent;
        transform: none;
    }

    .search-toggle {
        display: none;
    }

    /* Grid Desktop */
    .modelos-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .featured-slider .slider-item {
        min-width: calc(25% - 15px);
    }

    /* Filter Sidebar Desktop - mantém como drawer */
    .filters-sidebar {
        max-width: 400px;
    }

    .page-with-sidebar {
        display: flex;
        gap: 30px;
    }

    .page-with-sidebar .main-content {
        flex: 1;
    }

    /* Single Modelo Desktop */
    .modelo-gallery {
        width: 45%;
    }

    .modelo-info {
        width: 55%;
    }

    .modelo-details-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer Desktop */
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-column ul {
        columns: 1;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ========================================
   EXTRA LARGE DEVICES (1200px and up)
======================================== */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }

    .modelos-grid {
        gap: 25px;
    }

    .featured-slider .slider-item {
        min-width: calc(25% - 20px);
    }

    .modelo-name {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

/* ========================================
   XXL DEVICES (1400px and up)
======================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .modelos-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .featured-slider .slider-item {
        min-width: calc(20% - 16px);
    }
}

/* ========================================
   UTILITY CLASSES
======================================== */

/* Hide on specific breakpoints */
@media (max-width: 575.98px) {
    .d-none-xs { display: none !important; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .d-none-sm { display: none !important; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .d-none-md { display: none !important; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .d-none-lg { display: none !important; }
}

@media (min-width: 1200px) {
    .d-none-xl { display: none !important; }
}

/* Show on specific breakpoints */
@media (max-width: 575.98px) {
    .d-block-xs { display: block !important; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .d-block-sm { display: block !important; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .d-block-md { display: block !important; }
}

@media (min-width: 992px) {
    .d-block-lg { display: block !important; }
}

/* Mobile only */
@media (max-width: 991.98px) {
    .mobile-only { display: block !important; }
    .desktop-only { display: none !important; }
}

/* Desktop only */
@media (min-width: 992px) {
    .desktop-only { display: block !important; }
    .mobile-only { display: none !important; }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
======================================== */
@media (hover: none) and (pointer: coarse) {
    .modelo-card:hover .card-overlay {
        opacity: 0;
    }

    .modelo-card .card-overlay {
        opacity: 0;
        background: transparent;
    }

    /* Increase touch targets */
    .btn,
    button,
    a {
        min-height: 44px;
    }

    /* Disable hover effects */
    .menu-item:hover,
    .filter-option:hover {
        background: transparent;
    }
}

/* ========================================
   LANDSCAPE MOBILE
======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .age-verification-modal .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    .lightbox-content {
        max-height: 85vh;
    }

    .gallery-main {
        max-height: 60vh;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .site-header,
    .site-footer,
    .filters-sidebar,
    .scroll-to-top,
    .age-verification-modal,
    .btn-whatsapp,
    .share-btn,
    .favorite-btn {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .modelo-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* ========================================
   REDUCED MOTION
======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .main-navigation,
    .filters-sidebar,
    .search-container {
        transition: none;
    }
}

/* ========================================
   HIGH CONTRAST MODE
======================================== */
@media (prefers-contrast: high) {
    :root {
        --ec-primary: #ff6600;
        --ec-bg: #000000;
        --ec-bg-secondary: #1a1a1a;
        --ec-text: #ffffff;
        --ec-border: #ffffff;
    }

    .badge {
        border: 1px solid currentColor;
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* ========================================
   DARK MODE SUPPORT (for theme toggle)
======================================== */
body[data-theme="light"] {
    --ec-bg: #f5f5f5;
    --ec-bg-secondary: #ffffff;
    --ec-bg-tertiary: #e5e5e5;
    --ec-text: #1a1a1a;
    --ec-text-secondary: #666666;
    --ec-border: #dddddd;
}

body[data-theme="light"] .site-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--ec-border);
}

body[data-theme="light"] .modelo-card {
    background: var(--ec-bg-secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .site-footer {
    background: #1a1a1a;
    color: #ffffff;
}
