/* ===========================
   SellCode Responsive Styles
   Breakpoints: 1200, 992, 768, 576
   =========================== */

/* === Desktop: hide product cards beyond the 8th === */
#featured-products-grid > [class*="col-"]:nth-child(n+9) {
    display: none;
}

/* === Extra Large Devices (< 1200px) === */
@media (max-width: 1199.98px) {
    .hero-section {
        padding: 5rem 0;
    }

    .hero-section .display-3 {
        font-size: 2.75rem;
    }

    .product-main-img {
        height: 350px;
    }
}

/* === Large Devices / Tablets Landscape (< 992px) === */
@media (max-width: 991.98px) {
    /* Navbar */
    .navbar-collapse {
        background: var(--white);
        padding: 1rem;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        box-shadow: var(--shadow-md);
        margin-top: 0.5rem;
    }

    .navbar.navbar-transparent .navbar-collapse {
        background: rgba(30, 41, 59, 0.95);
        backdrop-filter: blur(10px);
    }

    .navbar-nav .nav-item {
        margin-bottom: 0.25rem;
    }

    .navbar-nav .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    /* Hero */
    .hero-section {
        padding: 4rem 0;
        text-align: center;
    }

    .hero-section .display-3 {
        font-size: 2.25rem;
    }

    .hero-section .lead {
        max-width: 100% !important;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-section .d-flex.gap-3 {
        justify-content: center;
    }

    /* Product Grid: 2 cols */
    .col-lg-3.col-md-4.col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Product detail */
    .product-main-img {
        height: 300px;
    }

    /* Dashboard sidebar (handled in dashboard.css) */
    .dashboard-sidebar {
        transform: translateX(-100%);
    }

    .dashboard-sidebar.open {
        transform: translateX(0);
    }

    .dashboard-content {
        margin-left: 0;
    }

    /* Filter sidebar */
    .filter-sidebar {
        position: static !important;
    }

    /* Tables */
    .table-responsive-custom {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* === Medium Devices / Tablets (< 768px) === */
@media (max-width: 767.98px) {
    /* Featured Scripts: single column, show only 4 cards */
    #featured-products-grid > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    #featured-products-grid > [class*="col-"]:nth-child(n+5) {
        display: none;
    }

    /* Top Sellers: show only 4 on mobile */
    .row.g-4 > .col-lg-4.col-md-6.col-12:nth-child(n+5) {
        display: none;
    }

    /* Stats Counter - Remove negative margin on mobile */
    #stats-section {
        margin-top: 2rem !important;
    }

    /* View More mobile button */
    .btn-view-more-mobile {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50px;
        padding: 0.625rem 1.75rem;
        font-size: 0.95rem;
    }

    /* Hero */
    .hero-section {
        padding: 3rem 0;
    }

    .hero-section .display-3 {
        font-size: 2rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .hero-section .btn-lg {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Page header */
    .page-header {
        padding: 2rem 0;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    /* Sections */
    section.py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    /* Step icons */
    .step-icon {
        width: 64px;
        height: 64px;
        font-size: 1.25rem;
    }

    /* Product detail page */
    .product-main-img {
        height: 250px;
    }

    /* Testimonial cards */
    .testimonial-card {
        margin-bottom: 1rem;
    }

    /* Stats counter */
    .stat-card h3 {
        font-size: 1.25rem;
    }

    /* Font adjustments */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.35rem; }
    h4 { font-size: 1.15rem; }

    /* Footer */
    footer {
        text-align: center;
    }

    footer .text-md-end {
        text-align: center !important;
        margin-top: 0.5rem;
    }

    footer .d-flex.gap-3 {
        justify-content: center;
    }

    /* CTA section */
    section .display-6 {
        font-size: 1.5rem;
    }

    /* Table scroll */
    .table-responsive,
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    /* Back to top */
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Top Sellers - Mobile Portrait */
    .seller-card-content {
        padding: 1.5rem 1.25rem;
    }

    .seller-avatar-wrapper img {
        width: 80px !important;
        height: 80px !important;
    }

    .seller-name {
        font-size: 1.1rem;
    }

    .seller-stats-group {
        gap: 0.75rem;
    }

    .seller-stat-box {
        padding: 0.875rem 0.75rem;
    }

    .seller-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .seller-stat-number {
        font-size: 1.15rem;
    }

    .seller-view-btn {
        height: 44px;
        font-size: 0.85rem;
    }
}

/* === Small Devices / Phones (< 576px) === */
@media (max-width: 575.98px) {
    /* Top Sellers - Modern Card Responsive */
    .seller-card-content {
        padding: 1.5rem 1.25rem;
    }

    .seller-avatar-wrapper img {
        width: 75px !important;
        height: 75px !important;
    }

    .seller-name {
        font-size: 1.05rem;
    }

    .seller-stats-group {
        gap: 0.75rem;
    }

    .seller-stat-box {
        padding: 0.75rem;
    }

    .seller-stat-icon {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .seller-stat-number {
        font-size: 1.1rem;
    }

    .seller-view-btn {
        height: 42px;
        font-size: 0.85rem;
    }

    /* Full-width columns */
    .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .row.g-4 > .col-lg-3.col-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    /* Hero */
    .hero-section {
        padding: 2.5rem 0;
    }

    .hero-section .display-3 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .hero-section .badge {
        font-size: 0.7rem;
    }

    .hero-section .lead {
        font-size: 0.9rem;
    }

    /* Page header */
    .page-header {
        padding: 1.5rem 0;
    }

    .page-header h2 {
        font-size: 1.35rem;
    }

    /* Product grid: 1 col */
    .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Cards */
    .card-body {
        padding: 1rem;
    }

    .card-body.p-4,
    .card-body.p-md-5 {
        padding: 1.25rem !important;
    }

    /* Buttons */
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .d-flex.gap-3 {
        gap: 0.5rem !important;
    }



    /* Product detail */
    .product-main-img {
        height: 200px;
    }

    .product-image-gallery {
        padding: 8px;
        margin-top: 12px;
    }

    .screenshot-thumbs {
        gap: 8px;
    }

    .screenshot-thumb {
        width: 70px;
        height: 52px;
        border-width: 2px;
    }

    .display-6 {
        font-size: 1.5rem;
    }

    /* Spacing */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .mb-5 {
        margin-bottom: 2rem !important;
    }

    .mt-5 {
        margin-top: 2rem !important;
    }

    /* Container padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Auth cards (login/register) */
    .col-md-5, .col-md-6 {
        padding-left: 0;
        padding-right: 0;
    }

    /* Contact info cards */
    .contact-card {
        padding: 1rem !important;
    }

    .contact-icon {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    /* Accordion */
    .accordion-button {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }

    /* Toast notifications */
    .sc-toast {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }

    /* Category section */
    .category-card .fa-2x {
        font-size: 1.5rem !important;
    }

    /* Back to top */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Category cards responsive */
    .category-card-enhanced {
        min-height: 120px;
    }

    .category-card-enhanced .category-content {
        padding: 0.875rem;
    }

    /* Product card code accent hidden on mobile */
    .product-card .card-img-container::after {
        display: none;
    }
}

/* === Extra Small Devices / iPhone SE, 5 (< 375px) === */
@media (max-width: 374.98px) {
    /* Hero */
    .hero-section {
        padding: 2rem 0;
    }

    .hero-section .display-3 {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .hero-section .lead {
        font-size: 0.825rem;
    }

    .hero-section .btn-lg {
        padding: 0.45rem 0.85rem;
        font-size: 0.8rem;
    }

    /* Container tighter padding */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Font sizes for readability at 320px */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.15rem; }
    h4 { font-size: 1rem; }

    /* Page header */
    .page-header h2 {
        font-size: 1.2rem;
    }

    /* Cards */
    .card-body {
        padding: 0.75rem;
    }

    .card-body.p-4,
    .card-body.p-md-5 {
        padding: 1rem !important;
    }

    /* Buttons touch-friendly */
    .btn {
        min-height: 44px;
        padding: 0.5rem 0.875rem;
    }

    .btn-sm {
        min-height: 36px;
    }

    .btn-lg {
        padding: 0.45rem 0.85rem;
        font-size: 0.825rem;
    }

    /* Product detail */
    .product-main-img {
        height: 180px;
    }

    .product-image-gallery {
        padding: 6px;
        margin-top: 10px;
    }

    .screenshot-thumbs {
        gap: 6px;
    }

    .screenshot-thumb {
        width: 55px;
        height: 42px;
        border-width: 2px;
    }

    /* Step icons */
    .step-icon {
        width: 52px;
        height: 52px;
        font-size: 1.1rem;
    }

    /* Contact */
    .contact-icon {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    /* Category */
    .category-card .fa-2x {
        font-size: 1.25rem !important;
    }

    /* Table column min-width for legibility */
    .table {
        min-width: 500px;
    }

    /* Prevent page horizontal overflow */
    body {
        overflow-x: hidden;
    }

    /* Spacing tighter */
    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .mb-5 {
        margin-bottom: 1.5rem !important;
    }

    /* Display headings */
    .display-6 {
        font-size: 1.3rem;
    }

    /* Seller card modern - extra small */
    .seller-card-content {
        padding: 1.25rem 1rem;
    }

    .seller-avatar-wrapper img {
        width: 70px !important;
        height: 70px !important;
    }

    .seller-name {
        font-size: 1rem;
    }

    .seller-stats-group {
        gap: 0.5rem;
    }

    .seller-stat-box {
        padding: 0.625rem;
    }

    .seller-stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .seller-stat-number {
        font-size: 1rem;
    }

    .seller-stat-text {
        font-size: 0.65rem;
    }

    .seller-view-btn {
        height: 40px;
        font-size: 0.8rem;
    }

    /* Back to top */
    .back-to-top {
        bottom: 0.75rem;
        right: 0.75rem;
        width: 36px;
        height: 36px;
    }

    .category-card-enhanced {
        min-height: 100px;
    }
}

/* === Print Styles === */
@media print {
    .navbar,
    footer,
    .back-to-top,
    .sc-toast,
    .btn,
    .sidebar {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
