/* Product Detail Page Mobile Responsive Styles */

/* Breadcrumb - Modern Professional Horizontal Scroll */
nav.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

nav.overflow-x-auto::-webkit-scrollbar {
    display: none;
}

nav.overflow-x-auto ul {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

nav.overflow-x-auto ul li {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

/* Desktop - Default styles work well */

/* Tablet Responsive (max-width: 1024px) */
@media (max-width: 1024px) {
    .product-detail-grid {
        gap: 2rem;
    }

    .product-gallery {
        max-width: 100%;
    }

    .product-info-section {
        padding: 1.5rem;
    }
}

/* Mobile Responsive (max-width: 768px) */
@media (max-width: 768px) {
    /* Breadcrumb Mobile */
    nav.overflow-x-auto {
        padding: 0.75rem 1rem;
        margin-bottom: 1.25rem;
        border-radius: 0.75rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    nav.overflow-x-auto ul {
        gap: 0.5rem !important;
        padding-bottom: 2px;
    }

    nav.overflow-x-auto ul li {
        font-size: 0.8125rem;
    }

    nav.overflow-x-auto ul li a {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }

    nav.overflow-x-auto ul li a i.fa-home {
        font-size: 0.875rem;
    }

    nav.overflow-x-auto ul li i.fa-chevron-right {
        font-size: 0.625rem;
        opacity: 0.5;
    }

    nav.overflow-x-auto ul li:last-child {
        font-size: 0.8125rem;
        padding: 0.375rem 0.5rem;
        max-width: none;
    }

    /* Product Detail Container */
    .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.25rem;
    }

    /* Product Gallery */
    .product-gallery {
        order: 1;
    }

    .product-gallery .aspect-square {
        border-radius: 1rem;
    }

    /* Product Info */
    .product-info {
        order: 2;
    }

    /* Product Title */
    h1.text-3xl {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    /* Rating and Vendor Section */
    .flex.items-center.gap-5 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* Price Section */
    .py-5.border-b {
        padding: 1rem 0;
    }

    .text-4xl {
        font-size: 2rem;
    }

    .text-2xl {
        font-size: 1.5rem;
    }

    /* Description */
    .product-description {
        max-height: 150px;
        overflow: hidden;
        position: relative;
    }

    .product-description.expanded {
        max-height: none;
    }

    /* Quantity Controls */
    .flex.items-center.border-2 {
        width: 100%;
        max-width: 200px;
    }

    .flex.items-center.border-2 button {
        width: 3rem;
        height: 3rem;
    }

    .flex.items-center.border-2 input {
        width: 4rem;
        height: 3rem;
    }

    /* Coupon Section */
    .mb-4.p-4 {
        padding: 1rem;
    }

    .flex.gap-2 {
        flex-direction: column;
    }

    .flex.gap-2 input {
        width: 100%;
    }

    .flex.gap-2 button {
        width: 100%;
    }

    /* Add to Cart Buttons */
    .flex.gap-4 {
        flex-direction: column;
        gap: 0.75rem;
    }

    .flex.gap-4 button[type="submit"] {
        width: 100%;
    }

    .flex.gap-4 button[type="button"] {
        width: 100%;
        height: 3rem;
    }

    /* Product Meta Grid */
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .grid.grid-cols-2 > div {
        padding: 0.75rem;
    }

    /* Related Products */
    .grid.sm\\:grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Reviews Section */
    .bg-white.rounded-2xl.shadow-md {
        padding: 1.25rem;
        border-radius: 1rem;
    }

    .text-3xl.font-bold {
        font-size: 1.5rem;
    }

    .flex.items-center.justify-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .flex.items-center.justify-between button,
    .flex.items-center.justify-between a {
        width: 100%;
        justify-content: center;
    }

    /* Review Form */
    #reviewForm {
        padding: 1rem;
    }

    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    #ratingStars button {
        font-size: 1.75rem;
    }

    /* Review Item */
    .review-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .review-avatar {
        width: 40px;
        height: 40px;
    }

    .review-content {
        width: 100%;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    /* Container Padding */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Product Detail */
    .grid.lg\\:grid-cols-2 {
        padding: 1rem;
        gap: 1rem;
    }

    /* Title */
    h1.text-3xl {
        font-size: 1.25rem;
    }

    /* Prices */
    .text-4xl {
        font-size: 1.75rem;
    }

    .text-2xl {
        font-size: 1.25rem;
    }

    /* Buttons */
    button, .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    /* Related Products */
    .grid.sm\\:grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Reviews */
    .bg-white.rounded-2xl.shadow-md {
        padding: 1rem;
    }

    .text-3xl.font-bold {
        font-size: 1.25rem;
    }

    /* Rating Stars */
    #ratingStars button {
        font-size: 1.5rem;
    }
}

/* Modern Enhancements */
@media (max-width: 768px) {
    /* Sticky Add to Cart on Mobile */
    .mobile-sticky-cart {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        z-index: 50;
        display: none;
    }

    .mobile-sticky-cart.show {
        display: block;
        animation: slideUp 0.3s ease-out;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    /* Image Gallery Touch Improvements */
    .product-gallery img {
        touch-action: pan-y pinch-zoom;
    }

    /* Better Touch Targets */
    button, a, input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improved Spacing */
    section.py-10 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    /* Badge Positioning */
    .badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    /* Stock Status */
    .stock-status {
        font-size: 0.875rem;
        padding: 0.5rem 0;
    }

    /* Vendor Info */
    .vendor-info {
        font-size: 0.875rem;
    }

    /* Product Meta Icons */
    .product-meta i {
        font-size: 1.25rem;
    }

    /* Review Avatar */
    .review-avatar {
        width: 36px;
        height: 36px;
    }

    /* Review Stars */
    .review-stars {
        font-size: 0.875rem;
    }

    /* Review Date */
    .review-date {
        font-size: 0.75rem;
    }

    /* Coupon Input */
    #couponCode {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }

    /* Discount Badge */
    .discount-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .product-gallery {
        order: 1;
    }

    .product-info {
        order: 2;
    }

    h1.text-3xl {
        font-size: 1.5rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger Touch Targets */
    button, a, input[type="button"], input[type="submit"] {
        min-height: 48px;
        padding: 0.75rem 1.5rem;
    }

    /* Remove Hover Effects */
    .hover\\:bg-orange-600:hover {
        background-color: #ea580c;
    }

    .hover\\:shadow-xl:hover {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }

    /* Better Tap Feedback */
    button:active, a:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

/* Print Styles */
@media print {
    .mobile-sticky-cart,
    button,
    .review-form,
    nav.breadcrumb {
        display: none !important;
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
    }

    .product-gallery,
    .product-info {
        page-break-inside: avoid;
    }
}
