/* --- Responsive Styles --- */

/* Adjustments for wider tablets and smaller laptops */
@media (max-width: 1200px) {
    .container {
        padding: 0 var(--spacing-md); /* Ensures content doesn't touch edges */
    }
    .hero-title {
        font-size: 4.5rem;
    }
    .hero-subtitle {
        font-size: 1.6rem;
    }
    .section-title {
        font-size: 2.8rem;
    }
    .features-grid, .product-grid {
        gap: var(--spacing-md);
    }
    .testimonial-card {
        flex: 0 0 400px; /* Reduced fixed width */
        padding: 30px;
    }
    .testimonial-text { /* Justify testimonial text */
        text-align: justify;
    }

    /* Products Page */
    .products-page-content {
        grid-template-columns: 250px 1fr; /* Sidebar slightly smaller */
    }

    /* Product Detail */
    .product-detail-page {
        grid-template-columns: 1fr 1.5fr; /* Keep ratio, adapt to padding */
    }
    .product-gallery {
        padding: var(--spacing-sm);
    }
    .product-info-area {
        padding-right: var(--spacing-sm);
        padding-left: var(--spacing-sm);
    }

    /* Cart Page */
    .cart-page-content {
        grid-template-columns: 1fr; /* Stack cart items and summary */
    }
    .cart-summary-card {
        padding: var(--spacing-md); /* Consistent padding */
    }
}

/* For tablets (portrait) and larger phones */
@media (max-width: 992px) {
    /* Ensure no horizontal overflow from padding/margin */
    body {
        overflow-x: hidden;
    }
    .container {
        padding: 0 var(--spacing-sm); /* Adjusted for smaller screens */
    }
    .header-inner, .about-brand-flex, .testimonials-carousel {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }

    /* Header adjustments */
    .desktop-nav {
        display: none;
    }
    .menu-toggle {
        display: block;
        order: -1;
        margin-left: var(--spacing-sm);
    }
    .header-inner {
        padding: 0 var(--spacing-sm); /* Adjusted for smaller screens */
        gap: var(--spacing-xs);
    }
    .header-left {
        flex-grow: 1;
        justify-content: center;
    }
    .site-title {
        display: none;
    }
    .site-logo {
        max-height: 50px;
    }
    .main-nav .nav-list {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.4s var(--transition-cubic);
        padding-top: 80px;
        gap: var(--spacing-md);
        box-shadow: var(--shadow-medium);
        overflow-y: auto;
    }
    .main-nav .nav-list.active {
        transform: translateX(0);
    }
    .main-nav .nav-link {
        font-size: 1.8rem;
        padding: 10px 0; /* Changed from var(--spacing-xs) for consistency */
        color: var(--text-color-heading);
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }
    .main-nav .nav-list.active .nav-link {
        opacity: 1;
        transform: translateY(0);
    }
    .main-nav .nav-list.active .nav-link:nth-child(1) { transition-delay: 0.1s; }
    .main-nav .nav-list.active .nav-link:nth-child(2) { transition-delay: 0.15s; }
    .main-nav .nav-list.active .nav-link:nth-child(3) { transition-delay: 0.2s; }
    .main-nav .nav-list.active .nav-link:nth-child(4) { transition-delay: 0.25s; }
    .main-nav .nav-link::after { display: none; }

    .header-right {
        gap: var(--spacing-xs);
    }
    .search-box {
        display: none;
    }
    .user-profile-icon {
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: var(--border-radius-sm);
    }
    .username-display {
        display: none;
    }
    .action-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
    .cart-count {
        font-size: 0.75rem;
        padding: 2px 7px;
        top: -5px;
        right: -5px;
        min-width: 24px;
    }

    /* Hero Section */
    .hero-section {
        padding: var(--spacing-md) 0;
        min-height: 500px;
    }
    .hero-title {
        font-size: 4rem;
    }
    .hero-subtitle {
        font-size: 1.4rem;
        margin-bottom: var(--spacing-md);
    }
    .btn-hero {
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    .hero-buttons .btn {
        width: 80%;
        margin: 0 auto;
    }

    /* Section Titles */
    .section-title {
        font-size: 2.5rem;
        margin-bottom: var(--spacing-md);
        padding-bottom: 15px;
    }
    .section-title::after {
        width: 80px;
        height: 4px;
    }

    /* Features Section */
    .features-section {
        margin-top: -80px;
        padding: var(--spacing-md) 0;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .feature-card {
        padding: var(--spacing-md);
    }
    .feature-card .icon-feature {
        font-size: 4rem;
    }
    .feature-card h3 {
        font-size: 1.8rem;
    }

    /* Products Page */
    .products-page-content {
        grid-template-columns: 1fr;
        padding: var(--spacing-md) 0; /* Ensures padding for the entire content area */
    }
    .sidebar {
        padding: var(--spacing-md);
    }
    .products-list-main {
        padding: 0;
    }

    /* Product Detail */
    .product-detail-page {
        grid-template-columns: 1fr;
        padding: var(--spacing-md);
    }
    .product-gallery {
        padding: var(--spacing-sm);
    }
    .main-image-display {
        height: 350px;
    }
    .product-info-area {
        padding: var(--spacing-sm) 0;
        text-align: center;
    }
    .product-price-detail, .product-availability {
        text-align: center;
    }
    .quantity-selector {
        justify-content: center;
    }
    .product-actions {
        justify-content: center;
    }
    .product-short-description, .product-tabs {
        margin-left: 0;
        margin-right: 0;
    }
    .product-short-description p { /* Justify product short description */
        text-align: justify;
    }
    .product-tabs .tab-button {
        font-size: 1rem;
        padding: var(--spacing-xs) 0;
    }
    .tab-pane h3 {
        text-align: center;
    }
    .tab-pane p, .tab-pane ul { /* Justify tab content text */
        text-align: justify;
    }
    .tab-pane ul {
        padding-right: var(--spacing-sm);
    }
    .review-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .review-stars {
        margin-top: 5px;
    }
    .review-comment-text { /* Justify review comments */
        text-align: justify;
    }


    /* Cart Page */
    .cart-page-content {
        padding: var(--spacing-md);
    }
    .cart-item-card {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
        padding: var(--spacing-xs);
        position: relative; /* Needed for absolute positioning of remove button */
    }
    .item-image-wrapper {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
        width: 70px;
        height: 70px;
    }
    .item-details {
        grid-column: 2 / -1;
        grid-row: 1 / 2;
        padding: 0 var(--spacing-xs);
    }
    .item-total-price {
        grid-column: 2 / -1;
        grid-row: 2 / 3;
        text-align: right;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        gap: var(--spacing-sm);
        font-size: 1.1rem;
    }
    .item-total-price .label {
        display: inline;
    }
    .remove-item-btn {
        position: absolute;
        top: var(--spacing-xs);
        left: var(--spacing-xs);
    }
    .cart-actions-bottom {
        text-align: center;
    }
    .cart-summary-card {
        padding: var(--spacing-md);
    }
    .summary-coupon-code {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    .coupon-input {
        width: 100%;
        text-align: center;
    }
    .coupon-btn {
        width: 100%;
    }
    .checkout-buttons-area {
        gap: var(--spacing-xs);
    }

    /* Auth Pages */
    .auth-form-wrapper {
        padding: var(--spacing-md); /* Adjusted padding */
    }
    .auth-title {
        font-size: 2.5rem;
    }
    .auth-links {
        font-size: 0.95rem;
    }

    /* Footer */
    .main-footer {
        padding-bottom: 90px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    .footer-section {
        padding: var(--spacing-sm) 0;
        text-align: center;
    }
    .footer-section h3 {
        margin-bottom: var(--spacing-sm);
    }
    .footer-about .logo-link {
        justify-content: center;
    }
    .social-links {
        justify-content: center;
    }
    .footer-nav-list {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .footer-newsletter-form {
        flex-direction: column;
        border-radius: var(--border-radius-md);
        background-color: transparent;
        border: none;
    }
    .newsletter-input {
        width: 100%;
        border-radius: var(--border-radius-md);
        margin-bottom: var(--spacing-xs);
        text-align: center;
        background-color: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    .newsletter-submit-btn {
        width: 100%;
        border-radius: var(--border-radius-md);
    }
    .footer-bottom {
        padding-top: var(--spacing-md);
    }
    .payment-icons {
        margin-top: var(--spacing-xs);
    }

    /* Mobile Sticky Navigation */
    .mobile-bottom-nav {
        display: flex;
    }
}

/* For small mobile phones */
@media (max-width: 600px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 2rem; }
    p { font-size: 1.05rem; } /* Adjusted paragraph font size */

    .site-logo {
        max-height: 45px;
    }
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    .cart-count {
        top: -4px;
        right: -4px;
        min-width: 20px;
        font-size: 0.6rem;
        padding: 1px 4px;
    }
    .user-profile-icon {
        padding: 6px 10px;
    }

    .hero-title {
        font-size: 3.5rem;
    }
    .hero-subtitle {
        font-size: 1.2rem;
    }
    .hero-buttons .btn {
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }

    .section-title {
        font-size: 2.2rem;
        padding-bottom: 10px;
    }
    .section-title::after {
        width: 80px;
        height: 4px;
    }

    .feature-card .icon-feature {
        font-size: 4rem;
    }
    .feature-card h3 {
        font-size: 1.6rem;
    }

    .product-image-wrapper {
        height: 200px;
    }
    .product-info-card h3 {
        font-size: 1.7rem;
    }
    .product-info-card .product-price {
        font-size: 1.5rem;
    }
    .product-actions .btn {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }

    .cta-title {
        font-size: 2.8rem;
    }
    .cta-subtitle {
        font-size: 1.1rem;
    }
    .newsletter-input, .newsletter-submit-btn {
        padding: 15px 20px;
        font-size: 1.05rem;
    }

    .testimonials-carousel {
        /* Allow flexible width for smaller screens */
        flex-wrap: nowrap; /* Keep it a carousel */
        padding-bottom: 25px; /* Ensure space for scrollbar */
        justify-content: flex-start; /* Align items to start */
    }
    .testimonial-card {
        padding: 30px;
        flex: 0 0 calc(100% - 2 * var(--spacing-md)); /* Adjust for gap */
        max-width: 480px; /* Maintain max-width for larger cards in carousel */
        box-sizing: border-box; /* Include padding and border in the width */
    }
    .testimonial-text {
        font-size: 1.05rem;
        text-align: justify;
    }

    .about-text p { /* Justify about text */
        text-align: justify;
    }

    .auth-form-wrapper {
        padding: 35px;
    }
    .auth-title {
        font-size: 2.5rem;
    }
    .auth-form input {
        padding: 12px 18px;
    }
    .auth-btn {
        padding: 16px;
        font-size: 1.2em;
    }
    .auth-links p {
        font-size: 0.9em;
    }

    .mobile-bottom-nav {
        height: 60px;
    }
    .mobile-nav-item i {
        font-size: 1.4rem;
    }
    .mobile-nav-item span {
        font-size: 0.8rem;
    }
    .mobile-cart-count {
        right: calc(50% - 15px);
        min-width: 18px;
        font-size: 0.6rem;
    }
}

/* Extra small mobile phones */
@media (max-width: 420px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.7rem; }
    p { font-size: 1rem; }

    .site-logo {
        max-height: 45px;
    }
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    .cart-count {
        top: -4px;
        right: -4px;
        min-width: 20px;
        font-size: 0.6rem;
        padding: 1px 4px;
    }
    .user-profile-icon {
        padding: 6px 10px;
    }

    .hero-title {
        font-size: 2.8rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .hero-buttons .btn {
        font-size: 1rem;
        padding: 0.8rem 1.6rem;
    }

    .section-title {
        font-size: 1.8rem;
    }
    .section-title::after {
        width: 50px;
        height: 3px;
    }

    .feature-card .icon-feature {
        font-size: 3.5rem;
    }
    .feature-card h3 {
        font-size: 1.4rem;
    }

    .product-image-wrapper {
        height: 180px;
    }
    .product-info-card h3 {
        font-size: 1.5rem;
    }
    .product-info-card .product-price {
        font-size: 1.3rem;
    }
    .product-actions .btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
    }

    .cta-title {
        font-size: 2.2rem;
    }
    .cta-subtitle {
        font-size: 0.95rem;
    }
    .newsletter-input, .newsletter-submit-btn {
        padding: 10px 15px;
        font-size: 0.95rem;
    }

    .testimonial-card {
        padding: 20px;
        flex: 0 0 calc(100% - var(--spacing-md)); /* Adjusted for very small screens */
    }
    .testimonial-text {
        font-size: 0.95rem;
        text-align: justify;
    }

    .auth-form-wrapper {
        padding: 25px;
    }
    .auth-title {
        font-size: 2.2rem;
    }
    .auth-form input {
        padding: 10px 15px;
    }
    .auth-btn {
        padding: 14px;
        font-size: 1.1em;
    }
}

    /* Tables */
    /* ... (existing table styles) ... */
    .admin-actions {
        flex-wrap: wrap; /* Allow action buttons to wrap on smaller screens */
        justify-content: center;
    }
    .admin-actions .action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        margin: 2px; /* Add slight margin when wrapped */
    }
    /* Specific styles for print/shipping buttons on wrap */
    .admin-actions .print-btn,
    .admin-actions .shipping-label-btn {
        font-size: 0.8rem; /* Smaller font size */
        padding: 6px 8px; /* Adjusted padding */
        width: auto; /* Allow width to adjust */
        border-radius: var(--admin-border-radius-sm); /* Keep rounded rect for better touch */
    }

    /* Filter/Sort bar for admin tables */
    .filter-sort-bar {
        flex-direction: column; /* Stack filters vertically */
        gap: var(--admin-spacing-sm);
        padding: var(--admin-spacing-sm);
    }
    .filter-sort-bar .form-group {
        width: 100%;
        min-width: unset;
    }
    .filter-sort-bar .search-group {
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    .filter-sort-bar .search-group .form-input {
        flex-grow: 1;
    }
    .filter-sort-bar .search-btn {
        flex-shrink: 0;
        width: auto; /* Allow button to shrink */
        padding: 8px 12px;
    }
    .status-update-select {
        width: 100%;
    }
    .status-update-select select {
        font-size: 0.8em;
    }

    /* Order Detail Page (Admin view) */
    /* ... (existing styles) ... */
}

/* For small mobile phones */
@media (max-width: 600px) {
    /* ... (existing mobile styles) ... */
    
    /* Filter/Sort bar */
    .filter-sort-bar .form-group label {
        font-size: 0.8rem;
    }
    .filter-sort-bar .form-input,
    .filter-sort-bar .form-select {
        font-size: 0.85rem;
        padding: 6px 10px;
        height: 32px;
    }
    .filter-sort-bar .search-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
        height: 32px;
    }

    /* Table Actions */
    .admin-actions {
        gap: 2px; /* Smaller gap */
    }
    .admin-actions .action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        margin: 1px;
    }
    .admin-actions .print-btn,
    .admin-actions .shipping-label-btn {
        font-size: 0.75rem;
        padding: 4px 6px;
    }
}

/* Extra small mobile phones */
@media (max-width: 420px) {
    /* ... (existing extra small mobile styles) ... */
    
    /* Filter/Sort bar */
    .filter-sort-bar .form-group label {
        font-size: 0.75rem;
    }
    .filter-sort-bar .form-input,
    .filter-sort-bar .form-select {
        font-size: 0.8rem;
        padding: 5px 8px;
        height: 30px;
    }
    .filter-sort-bar .search-btn {
        padding: 5px 8px;
        font-size: 0.8rem;
        height: 30px;
    }

    /* Table Actions */
    .admin-actions .action-btn {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    .admin-actions .print-btn,
    .admin-actions .shipping-label-btn {
        font-size: 0.65rem;
        padding: 3px 5px;
    }
}