/* 
 * Mobile-First Responsive CSS for SV Orthocare
 * Optimized for mobile devices and touch interactions
 */

/* Base mobile-first styles */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(68, 28, 85, 0.3);
}

/* Touch optimization */
a, button, input[type="button"], input[type="submit"], 
input[type="reset"], .btn, .theme-btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(68, 28, 85, 0.3);
}

/* Mobile typography */
body {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Mobile container adjustments */
.container, .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Mobile spacing */
.sec-pad {
    padding: 40px 0;
}

/* Mobile images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Mobile forms */
input, textarea, select {
    width: 100%;
    min-height: 44px;
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 6px;
    border: 1px solid #ddd;
    box-sizing: border-box;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Mobile buttons */
.theme-btn, .theme-btn-two, .theme-btn-three, .theme-btn-four,
.btn, button[type="submit"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
}

/* Mobile navigation fixes */
.mobile-nav-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Mobile modal improvements */
.modal {
    padding: 0 !important;
}

.modal-dialog {
    margin: 10px;
    max-width: calc(100vw - 20px);
    width: auto;
}

.modal-content {
    border-radius: 12px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

/* Mobile carousel improvements */
.owl-carousel .owl-nav button {
    background: rgba(68, 28, 85, 0.8) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    min-height: 44px !important;
    min-width: 44px !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(68, 28, 85, 0.3) !important;
}

.owl-carousel .owl-nav .owl-prev {
    left: 10px !important;
}

.owl-carousel .owl-nav .owl-next {
    right: 10px !important;
}

.owl-carousel .owl-dots {
    text-align: center;
    margin-top: 20px;
}

.owl-carousel .owl-dots .owl-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background: rgba(68, 28, 85, 0.3);
    border-radius: 50%;
    border: none;
    outline: none;
    cursor: pointer;
    touch-action: manipulation;
    min-height: 44px;
    min-width: 44px;
}

.owl-carousel .owl-dots .owl-dot.active {
    background: #DC9200;
}

/* Mobile-specific banner adjustments */
.banner-carousel .content-box {
    padding: 30px 20px;
    text-align: center;
}

.banner-carousel .content-box h2 {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 15px;
}

.banner-carousel .content-box p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.banner-carousel .btn-box {
    text-align: center;
}

.banner-carousel .btn-box .theme-btn {
    margin: 8px;
    width: auto;
    min-width: 140px;
}

/* Mobile service blocks */
.service-block {
    margin-bottom: 20px;
    text-align: center;
}

.service-block .inner-box {
    padding: 25px 20px;
    border-radius: 12px;
}

.service-block .icon-box {
    margin-bottom: 15px;
}

.service-block h4 {
    font-size: 18px;
    margin-bottom: 12px;
}

.service-block p {
    font-size: 14px;
    line-height: 1.6;
}

/* Mobile contact section */
.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-info .info-block {
    margin-bottom: 25px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 12px;
}

.contact-info .info-block .icon {
    margin-bottom: 15px;
    font-size: 24px;
    color: #DC9200;
}

.contact-info .info-block h4 {
    margin-bottom: 10px;
    color: #441C55;
}

.contact-info .info-block p {
    margin: 0;
    color: #666;
}

/* Mobile footer */
.main-footer {
    text-align: center;
    padding: 40px 0 20px;
}

.footer-widget {
    margin-bottom: 30px;
}

.footer-widget h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget ul li a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
    display: block;
    transition: color 0.3s ease;
}

.footer-widget ul li a:hover {
    color: #DC9200;
}

/* Mobile gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Mobile tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 300px;
}

table th,
table td {
    padding: 12px 8px;
    font-size: 14px;
    white-space: nowrap;
}

/* Mobile search */
.search-form {
    position: relative;
    margin-bottom: 20px;
}

.search-form input {
    padding-right: 50px;
}

.search-form button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #DC9200;
    border: none;
    color: white;
    width: 40px;
    height: 34px;
    border-radius: 4px;
    cursor: pointer;
}

/* Mobile alerts and notifications */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error,
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #b3d9ff;
}

/* Mobile loading states */
.loading {
    text-align: center;
    padding: 40px 20px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #DC9200;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus improvements for mobile accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #DC9200;
    outline-offset: 2px;
}

/* Hide elements on mobile if needed */
.mobile-hidden {
    display: none !important;
}

.mobile-only {
    display: block !important;
}

/* Tablet-specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .container, .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .banner-carousel .content-box h2 {
        font-size: 36px;
    }
    
    .theme-btn, .theme-btn-two, .theme-btn-three, .theme-btn-four {
        width: auto;
        min-width: 160px;
        display: inline-block;
        margin: 0 10px 10px 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
}

/* Large mobile (phablet) specific styles */
@media (min-width: 576px) and (max-width: 767px) {
    .banner-carousel .content-box h2 {
        font-size: 32px;
    }
    
    .service-block .inner-box {
        padding: 30px 25px;
    }
    
    .contact-info .info-block {
        padding: 25px;
    }
}

/* Small mobile specific styles */
@media (max-width: 480px) {
    .container, .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .sec-pad {
        padding: 30px 0;
    }
    
    .banner-carousel .content-box {
        padding: 20px 15px;
    }
    
    .banner-carousel .content-box h2 {
        font-size: 24px;
        line-height: 1.2;
    }
    
    .banner-carousel .content-box p {
        font-size: 14px;
    }
    
    .service-block .inner-box {
        padding: 20px 15px;
    }
    
    .contact-info .info-block {
        padding: 20px 15px;
    }
    
    .modal-dialog {
        margin: 5px;
        max-width: calc(100vw - 10px);
    }
    
    .modal-header,
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 10px 15px;
    }
    
    table th,
    table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .banner-carousel .content-box h2 {
        font-size: 20px;
    }
    
    .theme-btn, .theme-btn-two, .theme-btn-three, .theme-btn-four {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .service-block h4 {
        font-size: 16px;
    }
    
    .service-block p {
        font-size: 13px;
    }
}

/* Landscape mobile optimization */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .sec-pad {
        padding: 20px 0;
    }
    
    .banner-carousel .slide-item {
        padding: 30px 0 40px 0;
    }
    
    .banner-carousel .content-box {
        padding: 15px;
    }
    
    .banner-carousel .content-box h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .banner-carousel .content-box p {
        margin-bottom: 15px;
    }
    
    .modal-dialog {
        margin: 5px auto;
        max-height: calc(100vh - 10px);
        overflow-y: auto;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Optimize images for mobile */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: -moz-crisp-edges;
        image-rendering: crisp-edges;
    }
}

/* Print styles for mobile */
@media print {
    .mobile-nav,
    .hamburger,
    .owl-nav,
    .owl-dots,
    .floating-btn,
    .back-to-top {
        display: none !important;
    }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    .container, .container-fluid {
        width: auto;
        margin: 0;
        padding: 0;
    }
}
