/*===============================================
  RESPONSIVE STYLES - Mobile First Approach
===============================================*/

/*===============================================
  MOBILE MENU STYLES
===============================================*/
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

/* End mobile search */
.mobile-menu-sidebar,
.mini-cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 10000;
    transition: right var(--transition-base);
}

.mobile-menu-sidebar.active,
.mini-cart-sidebar.active {
    right: 0;
}

.mobile-menu-overlay,
.mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 9999;
}

.mobile-menu-sidebar.active ~ .mobile-menu-overlay,
.mini-cart-sidebar.active .mini-cart-overlay {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content,
.mini-cart-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
}

.mobile-menu-header,
.mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.close-mobile-menu,
.close-mini-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
}

.mobile-nav-menu li {
    border-bottom: 1px solid var(--border);
}

.mobile-nav-menu a {
    display: block;
    padding: var(--spacing-md) 0;
    font-weight: 500;
    color: var(--text-primary);
}

/*===============================================
  MODAL STYLES
===============================================*/
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    animation: modalFadeIn var(--transition-base);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}

.modal-body {
    padding: var(--spacing-2xl);
}

/*===============================================
  TOAST NOTIFICATIONS
===============================================*/
.toast-container {
    position: fixed;
    top: var(--spacing-xl);
    right: var(--spacing-xl);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    transform: translateX(400px);
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid var(--accent);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

.toast i {
    font-size: 1.25rem;
}

.toast-success i {
    color: var(--accent);
}

.toast-error i {
    color: var(--danger);
}

.toast-info i {
    color: var(--primary);
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

/*===============================================
  TABLET BREAKPOINT - 1024px
===============================================*/
@media (max-width: 1024px) {
    :root {
        --spacing-3xl: 3rem;
    }

    .hero-slider {
        height: 500px;
    }

    .slide-content {
        padding-top: 10%;
        padding-left: 10%;
        padding-right: 40%;
    }

    .slide-title {
        font-size: 2.5rem;
    }

    .slide-image img {
        max-width: 400px;
    }

    .slide-description {
        font-size: 1rem;
        margin-bottom: var(--spacing-xl);
        opacity: 0.9;
    }

    .slider-button {
        margin-top: 10px;
    }

    .deal-title {
        font-size: 2.5rem;
    }

    .deal-image img {
        max-width: 400px;
    }

    .product-title {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .product-price del {
        font-size: 0.7rem;
    }

    .product-category {
        font-size: 0.7rem;
    }
}

@media (max-width: 900px) {
    .products-grid-home {
        grid-template-columns: repeat(3, 1fr);
    }
}

/*===============================================
  TABLET BREAKPOINT - 768px
===============================================*/
@media (max-width: 768px) {
    :root {
        --spacing-2xl: 2rem;
        --spacing-3xl: 2.5rem;
    }

    /* Header */
    .top-bar {
        display: none;
    }

    .header-content {
        gap: var(--spacing-md);
    }

    .search-bar {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-navigation {
        display: none;
    }

    .header-action-btn span {
        display: none;
    }

    .wishlist-count {
        display: none;
    }

    .header-my-account {
        display: none;
    }

    /* Hero Slider */
    .hero-slider {
        height: 400px;
    }

    .slide-content {
        padding-right: 40%;
    }

    .slide-title {
        font-size: 2rem;
        margin-top: -10px;
    }

    .slide-description {
        font-size: 1rem;
    }

    .slide-actions {
        flex-direction: column;
        width: 100%;
    }

    .slide-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .slide-image {
        display: none;
    }

    .slider-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .slider-nav.prev {
        left: var(--spacing-sm);
    }

    .slider-nav.next {
        right: var(--spacing-sm);
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-md);
    }

    /* Products */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .woocommerce-breadcrumb {
        display: none;
    }

    .product-tabs {
        flex-wrap: wrap;
        width: 100%;
    }

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

    .tab-btn {
        flex: 1;
        min-width: 100px;
    }

    /* Deal Section */
    .deal-content {
        flex-direction: column;
        text-align: center;
    }

    .deal-title {
        font-size: 2rem;
    }

    .countdown-timer {
        justify-content: center;
    }

    .timer-item {
        min-width: 80px;
        padding: var(--spacing-md);
    }

    .timer-value {
        font-size: 2rem;
    }

    .deal-image {
        display: none;
    }

    /* Testimonials */
    .testimonials-slider {
        grid-template-columns: 1fr;
    }

    /* Newsletter */
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-icon {
        font-size: 3rem;
    }

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

    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }

    .newsletter-input,
    .newsletter-form .btn {
        width: 100%;
    }

    /* Footer */
    .footer-widgets-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    /* Dashboard */
    .dashboard-wrapper {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        position: relative;
    }

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

    .orders-table-wrapper {
        overflow-x: auto;
    }

    /* Product Page - Add proper padding */
    .single-product .content-area {
        padding: 0 var(--spacing-md);
    }

    .single-product .product {
        padding: var(--spacing-lg);
        gap: var(--spacing-lg);
        margin-top: 20px;
    }

    .single-product .summary {
        padding: var(--spacing-md);
    }
}

@media (max-width: 650px) {
    .products-grid-home {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .products-grid-home {
        grid-template-columns: 1fr;
    }
}

/*===============================================
  TABLET BREAKPOINT - 589px
===============================================*/
@media (max-width: 589px) {
    .slide-content {
        padding-top: 20%;
        padding-right: 0%;
    }

    .slide-description {
        margin-bottom: var(--spacing-md);
    }
}

/*===============================================
  MOBILE BREAKPOINT - 480px
===============================================*/
@media (max-width: 480px) {
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    /* Hero */
    .hero-slider {
        height: 350px;
    }

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

    .slide-description {
        font-size: 0.875rem;
    }

    .btn-lg {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.938rem;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

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

    .product-tabs {
        gap: var(--spacing-xs);
    }

    .tab-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.813rem;
    }

    .product-title {
        font-size: 0.875rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .action-btn {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    /* Deal */
    .deal-title {
        font-size: 1.5rem;
    }

    .countdown-timer {
        gap: var(--spacing-sm);
    }

    .timer-item {
        min-width: 70px;
        padding: var(--spacing-sm);
    }

    .timer-value {
        font-size: 1.5rem;
    }

    .timer-label {
        font-size: 0.75rem;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Toast */
    .toast-container {
        right: var(--spacing-sm);
        left: var(--spacing-sm);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* Modal */
    .modal-content {
        max-width: 95%;
    }

    .modal-body {
        padding: var(--spacing-lg);
    }

    /* Product Page Mobile - Better spacing */
    .single-product .content-area {
        padding: 0 var(--spacing-sm);
    }

    .single-product .product {
        padding: 0px;
        gap: var(--spacing-md);
    }

    .single-product .summary {
        padding: var(--spacing-sm);
    }

    .single-product .product_title {
        font-size: 1.25rem;
        margin-bottom: var(--spacing-md);
    }

    .single-product .price {
        font-size: 1.25rem;
        margin-bottom: var(--spacing-md);
    }

    .single-product .woocommerce-product-details__short-description {
        font-size: 0.875rem;
        margin-bottom: var(--spacing-md);
    }

    .single-product .cart button {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 1rem;
    }
}

/*===============================================
  LANDSCAPE ORIENTATION
===============================================*/
@media (max-height: 600px) and (orientation: landscape) {
    .hero-slider {
        height: 400px;
    }

    .modal-content {
        max-height: 95vh;
    }
}

/*===============================================
  PRINT STYLES
===============================================*/
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .mobile-menu-sidebar,
    .mini-cart-sidebar,
    .modal,
    .toast-container {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .product-card,
    .category-card,
    .testimonial-card {
        page-break-inside: avoid;
    }
}

/*===============================================
  DASHBOARD RESPONSIVE
===============================================*/
@media (max-width: 768px) {
    .dashboard-wrapper {
        display: block;
    }

    .dashboard-sidebar {
        margin-bottom: var(--spacing-xl);
    }

    .dashboard-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }

    .order-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .order-card {
        padding: var(--spacing-md);
    }

    .order-footer {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .addresses-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }
}

/*===============================================
  UTILITIES FOR RESPONSIVE
===============================================*/
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .mobile-flex {
        display: flex !important;
    }

    .mobile-grid {
        display: grid !important;
    }
}

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

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border: #000;
        --shadow-sm: none;
        --shadow-md: none;
        --shadow-lg: none;
    }

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