/* Responsive Styles for Whisgoo Marketplace */

/* Base Responsive Variables */
:root {
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .container {
        padding: 0 15px;
    }
    
    /* Header Responsive */
    .top-bar .container {
        flex-direction: column;
        align-items: center;
        padding: 8px 0;
    }
    
    .contact-info {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }
    
    #ubicacion-usuario {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        font-size: 14px;
        gap: 6px;
    }
    
    #ubicacion-usuario i {
        font-size: 16px;
    }
    
    .user-actions {
        width: 100%;
        text-align: center;
        margin: 5px 0;
        font-size: 12px;
    }
    
    .main-header .container {
        flex-wrap: wrap;
        padding: 10px 15px;
    }
    
    .logo {
        order: 1;
        flex-basis: 50%;
    }
    
    .logo svg {
        width: 120px;
        height: 40px;
    }
    
    .main-nav {
        position: relative;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--white-color);
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1001;
        border-radius: 0 0 10px 10px;
        padding: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
    }
    
    .nav-menu.active {
        display: flex;
        max-height: 500px;
        opacity: 1;
        box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu li a {
        padding: 12px 10px;
        font-size: 15px;
    }
    
    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 10px;
        top: 0;
        z-index: 1100;
        background: none;
        border: none;
        font-size: 28px;
        color: var(--text-color);
        padding: 8px 12px;
    }
    
    .search-bar {
        order: 3;
        flex-basis: 100%;
        margin: 10px 0;
        max-width: 100%;
    }
    
    .search-bar input {
        height: 40px;
        font-size: 14px;
    }
    
    .search-bar button {
        width: 40px;
        height: 40px;
    }
    
    /* Overlay para menú móvil */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.25);
        z-index: 1000;
        transition: opacity 0.3s ease;
        opacity: 0;
    }
    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Carousel Responsive */
    .carousel-container {
        height: 250px;
    }
    
    .carousel-content {
        padding: 0 20px;
    }
    
    .carousel-content h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .carousel-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .carousel-content .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Categories Responsive */
    .category-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0 5px;
    }
    
    .category-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 10px 8px;
        background: #fafbfc;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.03);
        min-height: 60px;
        gap: 12px;
    }
    
    .category-icon, .category-card img {
        width: 48px;
        height: 48px;
        object-fit: contain;
        margin-bottom: 0;
        margin-right: 8px;
        flex-shrink: 0;
    }
    
    .category-card h3 {
        font-size: 15px;
        margin: 0;
        font-weight: 500;
        text-align: left;
    }
    
    /* Product Grid Responsive */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 5px;
    }
    
    .product-card {
        padding: 10px;
    }
    
    .product-title {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .product-rating {
        font-size: 12px;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .add-to-cart, .wishlist {
        width: 100%;
        padding: 8px;
        font-size: 12px;
    }
    
    /* Deals Responsive */
    .deal-banner {
        padding: 20px 15px;
    }
    
    .deal-content {
        max-width: 100%;
        text-align: center;
    }
    
    .deal-content h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .deal-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .deal-content .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Section Headers */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-title {
        font-size: 20px;
        margin-bottom: 0;
    }
    
    .view-all {
        font-size: 13px;
    }
    
    /* Footer Responsive */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 15px;
    }
    
    .footer-column h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .footer-column ul li {
        margin-bottom: 8px;
    }
    
    .footer-column ul li a {
        font-size: 13px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }
    
    .payment-methods {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* Product Detail Responsive */
    .product-detail .container {
        grid-template-columns: 1fr;
    }
    
    .thumbnail-gallery {
        justify-content: center;
    }
    
    /* Product Tabs Responsive */
    .tabs-header {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 0 auto;
        text-align: center;
        padding: 10px;
    }
    
    .reviews-summary {
        flex-direction: column;
    }
    
    /* Featured Page Responsive */
    .filter-sort-container {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .sort-options {
        width: 100%;
    }
    
    .sort-options select {
        width: 100%;
    }
    
    /* Pagination Responsive */
    .pagination-container {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    /* Bestsellers Page Responsive */
    .top-products-grid {
        grid-template-columns: 1fr;
    }
    
    .reviews-slider {
        grid-template-columns: 1fr;
    }
    
    /* Cart Page Responsive */
    .cart-container {
        grid-template-columns: 1fr;
    }
    
    .cart-headers {
        display: none;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px 0;
    }
    
    .item-product {
        grid-column: 1;
    }
    
    .item-price {
        display: flex;
        align-items: center;
    }
    
    .item-price::before {
        content: 'Precio: ';
        margin-right: 5px;
        font-weight: normal;
    }
    
    .item-quantity {
        display: flex;
        align-items: center;
    }
    
    .item-quantity::before {
        content: 'Cantidad: ';
        margin-right: 5px;
    }
    
    .item-total {
        display: flex;
        align-items: center;
    }
    
    .item-total::before {
        content: 'Total: ';
        margin-right: 5px;
        font-weight: normal;
    }
    
    .item-actions {
        text-align: right;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .coupon-code {
        width: 100%;
    }
    
    .coupon-code input {
        flex: 1;
    }
    
    .update-cart-btn {
        width: 100%;
    }
    
    .shopping-policy .policy-grid {
        grid-template-columns: 1fr;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Header Responsive */
    .main-header .container {
        flex-wrap: wrap;
        padding: 15px;
    }
    
    .logo {
        order: 1;
        flex-basis: 30%;
    }
    
    .search-bar {
        order: 2;
        flex-basis: 70%;
        margin-right: 0;
    }
    
    .main-nav {
        order: 3;
        flex-basis: 100%;
        margin-top: 15px;
    }
    
    /* Categories Responsive */
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Product Grid Responsive */
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Footer Responsive */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    /* Product Detail Responsive */
    .product-detail .container {
        gap: 20px;
    }
    
    /* Bestsellers Page Responsive */
    .top-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reviews-slider {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Cart Page Responsive */
    .cart-container {
        gap: 20px;
    }
    
    .shopping-policy .policy-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Product Grid Responsive */
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Product Detail Responsive */
    .product-detail .container {
        gap: 30px;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .section-title {
        font-size: 20px;
    }
    
    /* Categories Responsive */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Product Grid Responsive */
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    /* Deal Banner Responsive */
    .deal-banner {
        padding: 20px;
    }
    
    .deal-content {
        max-width: 100%;
        text-align: center;
    }
    
    .deal-content h2 {
        font-size: 20px;
    }
    
    /* Product Detail Responsive */
    .product-variants .variant-options {
        flex-wrap: wrap;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .quantity-control {
        width: 100%;
    }
    
    .quantity-control input {
        flex: 1;
    }
    
    .product-benefits {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    /* Tab Content Responsive */
    .tab-content {
        padding: 0;
    }
    
    /* Pagination Responsive */
    .page-btn {
        width: 30px;
        height: 30px;
    }
}

/* Specific Adjustments for Different View Types */

/* For tablets in portrait mode */
@media (min-width: 768px) and (max-width: 991.98px) and (orientation: portrait) {
    .carousel-container {
        height: 350px;
    }
}

/* For tablets in landscape mode */
@media (min-width: 768px) and (max-width: 991.98px) and (orientation: landscape) {
    .carousel-container {
        height: 400px;
    }
}

/* For mobile devices in landscape mode */
@media (max-width: 767.98px) and (orientation: landscape) {
    .carousel-container {
        height: 180px;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print styles */
@media print {
    header,
    footer,
    .carousel,
    .newsletter,
    .deals,
    .product-actions,
    .related-products,
    .recently-viewed {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .container {
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .product-detail .container {
        display: block;
    }
    
    .product-gallery {
        width: 50%;
        float: left;
        margin-right: 20px;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        font-weight: normal;
    }
    
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
    
    .product-tabs {
        page-break-before: always;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .tabs-header {
        display: none;
    }
}
