/* ==============================================
   MOBILE RESPONSIVE STYLES
   Complete mobile optimization for all devices
   ============================================== */

/* ===== BASE MOBILE UTILITIES ===== */
.mobile-only { display: none !important; }
.desktop-only { display: block !important; }

/* ===== TABLET BREAKPOINT (max-width: 991.98px) ===== */
@media (max-width: 991.98px) {
    /* Typography */
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
    
    .display-4 { font-size: 2rem; }
    .display-5 { font-size: 1.75rem; }
    .display-6 { font-size: 1.5rem; }
    
    /* Cards */
    .card { margin-bottom: 1rem; }
    
    /* Buttons */
    .btn-lg {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px;
    }
    
    .related-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 14px;
    }
}

/* ===== MOBILE PHONE BREAKPOINT (max-width: 767.98px) ===== */
@media (max-width: 767.98px) {
    /* Visibility utilities */
    .mobile-only { display: block !important; }
    .desktop-only { display: none !important; }
    
    /* ===== TYPOGRAPHY MOBILE ===== */
    html {
        font-size: 15px;
    }
    
    h1, .h1 { font-size: 1.45rem; }
    h2, .h2 { font-size: 1.25rem; }
    h3, .h3 { font-size: 1.1rem; }
    h4, .h4 { font-size: 0.95rem; }
    h5, .h5 { font-size: 0.9rem; }
    
    .display-4 { font-size: 1.65rem; }
    .display-5 { font-size: 1.45rem; }
    .display-6 { font-size: 1.2rem; }
    
    p {
        font-size: 0.9rem;
        line-height: 1.55;
    }
    
    /* ===== SHOP PAGE ===== */
    .shop-hero {
        padding: 1rem 0.85rem !important;
        border-radius: 14px !important;
        margin-bottom: 0.85rem !important;
    }
    
    .shop-hero h1 {
        font-size: 1.25rem !important;
        margin-bottom: 0.3rem !important;
    }
    
    .shop-hero p {
        font-size: 0.8rem !important;
        margin-bottom: 0 !important;
        opacity: 0.9;
    }
    
    /* Categories Scroll */
    .categories-scroll {
        gap: 6px;
        padding: 0.2rem 0;
        margin-bottom: 0.85rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-chip {
        padding: 7px 12px;
        font-size: 0.75rem;
        border-radius: 20px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .category-chip i {
        font-size: 0.85rem;
    }
    
    /* Filters Bar */
    .filters-bar {
        padding: 0.65rem;
        border-radius: 10px;
        margin-bottom: 0.85rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .filters-left {
        flex-direction: column;
        gap: 0.4rem;
        width: 100%;
    }
    
    .result-count {
        font-size: 0.85rem;
        text-align: center;
    }
    
    .sort-select {
        width: 100%;
        padding: 8px 12px;
        font-size: 16px !important; /* Previne zoom iOS */
        border-radius: 8px;
    }
    
    .active-filter {
        padding: 5px 10px;
        font-size: 0.75rem;
        border-radius: 15px;
    }
    
    /* Products Grid Mobile - 2 coloane */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    /* Product Card Mobile */
    .product-card,
    .related-card {
        border-radius: 12px;
        overflow: hidden;
    }
    
    .product-card .card-body,
    .related-card-body {
        padding: 0.65rem;
    }
    
    .product-card .card-title,
    .product-name {
        font-size: 0.8rem !important;
        line-height: 1.3;
        margin-bottom: 0.25rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-card .product-price,
    .product-price,
    .p-current-price {
        font-size: 0.95rem !important;
        font-weight: 700;
    }
    
    .product-old-price,
    .p-old-price {
        font-size: 0.7rem !important;
    }
    
    .product-badge {
        padding: 0.15rem 0.45rem;
        font-size: 0.6rem;
        top: 5px;
        left: 5px;
    }
    
    .product-card .btn,
    .btn-add-cart {
        padding: 0.35rem 0.65rem;
        font-size: 0.7rem;
        border-radius: 8px;
    }
    
    .product-image,
    .product-card img {
        height: 130px !important;
        object-fit: cover;
    }
    
    .product-placeholder {
        height: 130px !important;
    }
    
    /* Product Actions - Visible on mobile */
    .product-actions {
        opacity: 1;
        transform: none;
    }
    
    .btn-action {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    /* Related Products Grid */
    .related-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .related-card img {
        height: 110px !important;
    }
    
    .related-card h6 {
        font-size: 0.75rem;
    }
    
    /* Pagination Mobile */
    .pagination-section {
        margin-top: 1.5rem;
    }
    
    .page-btn {
        min-width: 38px;
        height: 38px;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .pagination-info {
        font-size: 0.75rem;
    }
    
    /* ===== HOME PAGE ===== */
    .hero-section {
        margin-left: -0.65rem;
        margin-right: -0.65rem;
        margin-top: 0.5rem;
    }
    
    .hero-bg {
        padding: 1.25rem 1rem !important;
        min-height: 130px !important;
        border-radius: 14px !important;
    }
    
    .hero-title {
        font-size: 1.3rem !important;
        margin-bottom: 0.35rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.8rem !important;
        margin-bottom: 0.85rem !important;
        line-height: 1.45;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.45rem;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 240px;
        padding: 0.55rem 1rem !important;
        font-size: 0.85rem;
    }
    
    /* Section Headers */
    .section-header {
        margin-bottom: 0.85rem !important;
        margin-top: 1.25rem !important;
    }
    
    .section-title {
        font-size: 1.15rem !important;
    }
    
    .section-subtitle {
        font-size: 0.75rem;
    }
    
    /* Category Cards */
    .category-card {
        padding: 0.85rem 0.5rem;
        border-radius: 12px;
    }
    
    .category-icon {
        font-size: 1.6rem !important;
    }
    
    .category-image {
        width: 45px !important;
        height: 45px !important;
        border-radius: 10px;
    }
    
    .category-name {
        font-size: 0.75rem;
        margin-top: 0.35rem;
    }
    
    .category-arrow {
        display: none;
    }
    
    /* Contact Section */
    .contact-card {
        padding: 1.1rem;
        border-radius: 14px;
    }
    
    .contact-items {
        gap: 0.85rem;
    }
    
    .contact-icon {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    
    .contact-label {
        font-size: 0.65rem;
    }
    
    .contact-value {
        font-size: 0.8rem;
    }
    
    .map-wrapper {
        min-height: 220px;
        border-radius: 14px;
        margin-top: 1rem;
    }
    
    /* Social Links */
    .social-icons {
        gap: 0.45rem;
    }
    
    .social-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .app-store-btn {
        width: 100%;
        justify-content: center;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    /* ===== PRODUCT PAGE ===== */
    .product-gallery {
        border-radius: 14px;
        margin-bottom: 1rem;
    }
    
    .main-image-container {
        height: 260px !important;
    }
    
    .gallery-nav {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    
    .gallery-nav.prev { left: 6px; }
    .gallery-nav.next { right: 6px; }
    
    .thumbnail-strip {
        padding: 8px;
        gap: 6px;
    }
    
    .thumb-item {
        width: 55px;
        height: 55px;
        border-radius: 8px;
    }
    
    .product-badges {
        top: 8px;
        left: 8px;
    }
    
    .badge-item {
        padding: 4px 9px;
        font-size: 0.65rem;
    }
    
    .product-info-card {
        padding: 1.1rem;
        border-radius: 14px;
    }
    
    .product-title {
        font-size: 1.3rem !important;
        margin-bottom: 0.25rem;
        line-height: 1.3;
    }
    
    .product-sku {
        font-size: 0.7rem;
        margin-bottom: 0.85rem;
    }
    
    .rating-display {
        margin-bottom: 0.85rem;
    }
    
    .rating-display .stars i {
        font-size: 0.9rem;
    }
    
    .rating-text {
        font-size: 0.75rem;
    }
    
    /* Variant Selector Mobile */
    .variant-selector {
        padding: 0.85rem;
        border-radius: 12px;
        margin-bottom: 0.85rem;
    }
    
    .variant-selector-title {
        font-size: 0.85rem;
        margin-bottom: 0.45rem;
    }
    
    .variant-options {
        flex-direction: column;
        gap: 6px;
    }
    
    .variant-option {
        min-width: 100%;
        padding: 9px 12px;
        border-radius: 10px;
    }
    
    .variant-option .variant-name {
        font-size: 0.85rem;
    }
    
    .variant-option .variant-price,
    .variant-option .variant-stock {
        font-size: 0.7rem;
    }
    
    /* Price Section Mobile */
    .price-section {
        padding: 0.85rem;
        border-radius: 12px;
        margin-bottom: 0.85rem;
    }
    
    .current-price {
        font-size: 1.65rem !important;
    }
    
    .old-price {
        font-size: 0.95rem !important;
        margin-left: 6px;
    }
    
    .discount-tag {
        padding: 3px 7px;
        font-size: 0.7rem;
        margin-left: 6px;
    }
    
    .price-per-unit {
        font-size: 0.7rem;
    }
    
    /* Stock Status */
    .stock-status {
        padding: 9px 11px;
        border-radius: 10px;
        margin-bottom: 0.85rem;
    }
    
    .stock-icon {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
    
    /* Short Description */
    .short-description {
        font-size: 0.85rem;
        margin-bottom: 0.85rem;
        padding-bottom: 0.85rem;
        line-height: 1.5;
    }
    
    /* Quick Features */
    .quick-features {
        grid-template-columns: 1fr !important;
        gap: 7px;
        margin-bottom: 0.85rem;
    }
    
    .quick-feature {
        padding: 8px 11px;
        font-size: 0.75rem;
        border-radius: 10px;
    }
    
    .quick-feature i {
        font-size: 0.95rem;
    }
    
    /* Quantity Selector */
    .quantity-selector {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 0.85rem;
    }
    
    .qty-label {
        font-size: 0.85rem;
    }
    
    .qty-controls {
        border-radius: 10px;
    }
    
    .qty-btn {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
    
    .qty-input {
        width: 48px;
        height: 38px;
        font-size: 16px !important; /* Previne zoom iOS */
    }
    
    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
        gap: 9px;
        margin-bottom: 0.85rem;
    }
    
    .btn-add-to-cart {
        padding: 13px 18px !important;
        font-size: 0.95rem !important;
        border-radius: 12px;
    }
    
    .btn-wishlist {
        width: 100%;
        height: 46px;
        border-radius: 12px;
    }
    
    /* Trust Badges */
    .trust-badges {
        grid-template-columns: repeat(3, 1fr);
        gap: 7px;
        padding-top: 0.85rem;
    }
    
    .trust-badge {
        padding: 9px 5px;
        border-radius: 10px;
    }
    
    .trust-badge i {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    
    .trust-badge span {
        font-size: 0.6rem;
    }
    
    /* Product Details Tabs */
    .product-details-section {
        border-radius: 14px;
        margin-top: 1.25rem;
    }
    
    .details-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .details-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        min-width: 90px;
        padding: 11px 13px;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .tab-btn i {
        display: none;
    }
    
    .tab-content {
        padding: 1.1rem;
    }
    
    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .feature-card {
        padding: 12px;
    }
    
    .feature-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .feature-content h4 {
        font-size: 0.85rem;
    }
    
    .feature-content p {
        font-size: 0.75rem;
    }
    
    /* Specs Table */
    .specs-table td {
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .specs-table td:first-child {
        width: 45%;
    }
    
    /* Reviews Section */
    .reviews-section {
        padding: 1.1rem;
        border-radius: 14px;
        margin-top: 1.25rem;
    }
    
    .reviews-header {
        flex-direction: column;
        gap: 0.85rem;
    }
    
    .reviews-header .btn {
        width: 100%;
    }
    
    .avg-rating .big-number {
        font-size: 2.2rem;
    }
    
    .review-card {
        padding: 0.85rem;
        border-radius: 12px;
    }
    
    .reviewer-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
    
    .reviewer-name {
        font-size: 0.85rem;
    }
    
    .reviewer-date {
        font-size: 0.7rem;
    }
    
    .review-rating .stars i {
        font-size: 0.8rem;
    }
    
    .review-form-card {
        padding: 0.85rem;
        border-radius: 12px;
    }
    
    .star-rating-input i {
        font-size: 1.4rem;
    }
    
    /* ===== CART PAGE ===== */
    .cart-item {
        flex-direction: column;
        gap: 0.85rem !important;
        padding: 0.85rem 0 !important;
    }
    
    .cart-item .flex-shrink-0 img,
    .cart-item .flex-shrink-0 .bg-light {
        width: 75px !important;
        height: 75px !important;
        border-radius: 10px;
    }
    
    .cart-item .flex-grow-1 h6 {
        font-size: 0.9rem;
    }
    
    .cart-item .input-group {
        width: 95px !important;
    }
    
    .cart-item .text-end {
        min-width: auto !important;
    }
    
    /* Cart Summary */
    .bg-white.rounded-4.shadow-sm.p-4.sticky-top {
        position: relative !important;
        top: auto !important;
        padding: 0.85rem !important;
        border-radius: 14px !important;
    }
    
    /* ===== CHECKOUT PAGE ===== */
    .payment-option {
        padding: 0.65rem !important;
        border-radius: 12px;
    }
    
    .payment-option .d-flex {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    
    .payment-option .me-3 {
        margin-right: 0.4rem !important;
    }
    
    /* TBI Bank Options */
    .tbi-rate-option label {
        min-width: 75px;
        padding: 0.35rem 0.55rem;
        font-size: 0.7rem;
    }
    
    #tbiInstallmentsSection .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #tbiInstallmentsSection .d-flex > .d-flex {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
    }
    
    /* Order Summary in Checkout */
    .border.rounded-3.p-3 {
        max-height: 180px !important;
    }
    
    /* ===== FORMS MOBILE ===== */
    .form-control,
    .form-select {
        font-size: 16px !important; /* Previne iOS zoom */
        padding: 0.55rem 0.7rem;
        border-radius: 10px;
    }
    
    .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.35rem;
    }
    
    textarea.form-control {
        min-height: 90px;
    }
    
    .form-check-input {
        width: 1.15rem;
        height: 1.15rem;
    }
    
    /* ===== MODALS MOBILE ===== */
    .modal-dialog {
        margin: 0.4rem;
        max-width: calc(100% - 0.8rem);
    }
    
    .modal-content {
        border-radius: 14px;
    }
    
    .modal-header {
        padding: 0.85rem;
    }
    
    .modal-body {
        padding: 0.85rem;
    }
    
    .modal-footer {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        flex: 1;
    }
    
    /* ===== ALERTS ===== */
    .alert {
        padding: 0.65rem;
        font-size: 0.8rem;
        border-radius: 10px;
    }
    
    /* ===== BREADCRUMB ===== */
    .breadcrumb {
        font-size: 0.75rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.4rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .breadcrumb::-webkit-scrollbar {
        display: none;
    }
    
    .breadcrumb-item {
        flex-shrink: 0;
    }
    
    /* ===== LIGHTBOX MOBILE ===== */
    .lightbox-close {
        top: 8px;
        right: 8px;
        width: 38px;
        height: 38px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .lightbox-nav.prev { left: 8px; }
    .lightbox-nav.next { right: 8px; }
    
    /* ===== EMPTY STATES ===== */
    .empty-state {
        padding: 2rem 1.25rem;
        border-radius: 14px;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    .empty-state h4 {
        font-size: 1rem;
    }
    
    .empty-state p {
        font-size: 0.85rem;
    }
    
    /* ===== BUTTONS MOBILE ===== */
    .btn {
        min-height: 42px;
        padding: 0.55rem 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .btn-sm {
        min-height: 34px;
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        min-height: 48px;
        padding: 0.7rem 1.25rem;
        font-size: 1rem;
    }
}

/* ===== EXTRA SMALL PHONES (max-width: 479.98px) ===== */
@media (max-width: 479.98px) {
    /* Even smaller text */
    html {
        font-size: 14px;
    }
    
    h1, .h1 { font-size: 1.25rem; }
    h2, .h2 { font-size: 1.1rem; }
    
    /* Products Grid - compact */
    .products-grid {
        gap: 7px !important;
    }
    
    .product-card .card-body {
        padding: 0.45rem;
    }
    
    .product-card .card-title,
    .product-name {
        font-size: 0.7rem !important;
        -webkit-line-clamp: 2;
    }
    
    .product-card .product-price,
    .product-price {
        font-size: 0.85rem !important;
    }
    
    .product-image,
    .product-card img {
        height: 110px !important;
    }
    
    .product-card .btn {
        padding: 0.3rem 0.45rem;
        font-size: 0.65rem;
    }
    
    /* Hero compact */
    .hero-bg {
        padding: 1rem 0.85rem !important;
        min-height: 110px !important;
    }
    
    .hero-title {
        font-size: 1.15rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.75rem !important;
    }
    
    .hero-buttons .btn {
        padding: 0.5rem 0.85rem !important;
        font-size: 0.8rem;
    }
    
    /* Categories */
    .category-card {
        padding: 0.7rem 0.35rem;
    }
    
    .category-icon {
        font-size: 1.4rem !important;
    }
    
    .category-image {
        width: 40px !important;
        height: 40px !important;
    }
    
    .category-name {
        font-size: 0.65rem;
    }
    
    /* Product Page */
    .main-image-container {
        height: 220px !important;
    }
    
    .product-title {
        font-size: 1.15rem !important;
    }
    
    .current-price {
        font-size: 1.4rem !important;
    }
    
    .old-price {
        font-size: 0.85rem !important;
    }
    
    /* Cart Item */
    .cart-item .flex-shrink-0 img,
    .cart-item .flex-shrink-0 .bg-light {
        width: 65px !important;
        height: 65px !important;
    }
    
    /* Trust Badges - stack */
    .trust-badges {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .trust-badge {
        display: flex;
        align-items: center;
        gap: 8px;
        text-align: left;
        padding: 8px 10px;
    }
    
    .trust-badge i {
        margin-bottom: 0;
        font-size: 1.2rem;
    }
    
    /* Related Products */
    .related-grid {
        gap: 7px;
    }
    
    .related-card img {
        height: 95px !important;
    }
    
    .related-card h6 {
        font-size: 0.7rem;
    }
    
    .related-card .price {
        font-size: 0.8rem;
    }
    
    /* Contact */
    .contact-card {
        padding: 0.95rem;
    }
    
    .contact-icon {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    
    .contact-value {
        font-size: 0.75rem;
    }
}

/* ===== TOUCH-FRIENDLY IMPROVEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    /* Remove hover effects on touch */
    .product-card:hover,
    .category-card:hover {
        transform: none;
    }
    
    .product-actions {
        opacity: 1;
        transform: none;
    }
    
    /* Better scrolling */
    .categories-scroll,
    .thumbnail-strip,
    .details-tabs {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-chip,
    .thumb-item,
    .tab-btn {
        scroll-snap-align: start;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-width: 767.98px) and (orientation: landscape) {
    .main-image-container {
        height: 180px !important;
    }
    
    .hero-bg {
        min-height: 100px !important;
        padding: 0.85rem !important;
    }
    
    .hero-title {
        font-size: 1.1rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.75rem !important;
        margin-bottom: 0.6rem !important;
    }
    
    .hero-buttons {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .hero-buttons .btn {
        width: auto;
        flex: 1;
        max-width: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .product-image,
    .product-card img {
        height: 100px !important;
    }
}

/* ===== SAFE AREA (for notched phones) ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 767.98px) {
        body {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }
        
        .modal-dialog {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .dev-card,
    .service-card,
    .admin-panel,
    .admin-toggle,
    .navbar,
    .footer,
    .btn,
    .action-buttons,
    .quantity-selector,
    .product-actions,
    .hero-buttons {
        display: none !important;
    }
    
    .product-info-card,
    .product-gallery {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
}
