/* ===================================
   MOBILE RESPONSIVE & PROFESSIONAL CSS
   Enhanced for iPhone, Android, Chrome & Safari
   =================================== */

/* Viewport and Base Mobile Styles */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Enhanced Touch Interactions */
button, .btn, a, input, select, textarea {
    -webkit-tap-highlight-color: rgba(184, 134, 11, 0.2);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Navigation will be handled by mobile-navigation.css */

/* Header Responsive Design */
@media (max-width: 768px) {
    .top-header {
        padding: 8px 0;
    }
    
    .contact-info {
        display: none;
    }
    
    .user-actions {
        justify-content: center;
        gap: 10px;
    }
    
    .main-nav {
        padding: 12px 0;
    }
    
    .logo-img {
        height: 35px !important;
        width: auto;
    }
    
    .search-bar {
        margin: 15px 0;
    }
    
    .search-form .input-group {
        border-radius: 25px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .search-form .form-control {
        border: none;
        padding: 12px 20px;
        font-size: 16px;
        background: #f8f9fa;
    }
    
    .search-form .btn {
        border: none;
        padding: 12px 20px;
        background: linear-gradient(135deg, #B8860B, #DAA520);
    }
    
    .header-actions {
        text-align: center !important;
        margin-top: 10px;
    }
    
    .cart-icon {
        font-size: 24px;
        padding: 12px;
        background: linear-gradient(135deg, #B8860B, #DAA520);
        color: white;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
    }
}

/* Product Cards Mobile Optimization */
@media (max-width: 768px) {
    .product-card {
        margin-bottom: 20px;
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }
    
    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    }
    
    .product-image {
        height: 200px;
        overflow: hidden;
        position: relative;
    }
    
    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .product-card:hover .product-image img {
        transform: scale(1.05);
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-title {
        font-size: 16px;
        font-weight: 600;
        color: #2C3E50;
        margin-bottom: 8px;
        line-height: 1.4;
    }
    
    .product-price {
        font-size: 18px;
        font-weight: 700;
        color: #B8860B;
        margin-bottom: 12px;
    }
    
    .btn-add-to-cart {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        font-weight: 600;
        background: linear-gradient(135deg, #B8860B, #DAA520);
        border: none;
        color: white;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    
    .btn-add-to-cart:hover {
        background: linear-gradient(135deg, #DAA520, #B8860B);
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(184, 134, 11, 0.4);
    }
}

/* Form Elements Mobile Enhancement */
@media (max-width: 768px) {
    .form-control, .form-select {
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 10px;
        border: 2px solid #e9ecef;
        transition: all 0.3s ease;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .form-control:focus, .form-select:focus {
        border-color: #B8860B;
        box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
        outline: none;
    }
    
    .btn-primary {
        padding: 15px 30px;
        font-size: 16px;
        font-weight: 600;
        background: linear-gradient(135deg, #B8860B, #DAA520);
        border: none;
        border-radius: 10px;
        transition: all 0.3s ease;
    }
    
    .btn-primary:hover {
        background: linear-gradient(135deg, #DAA520, #B8860B);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(184, 134, 11, 0.4);
    }
}

/* Cart Page Mobile Improvements */
@media (max-width: 768px) {
    .cart-item {
        padding: 15px;
        margin-bottom: 15px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 10px;
    }
    
    .cart-item-details {
        text-align: center;
    }
    
    .cart-item-title {
        font-size: 16px;
        font-weight: 600;
        color: #2C3E50;
        margin-bottom: 8px;
    }
    
    .cart-item-price {
        font-size: 18px;
        font-weight: 700;
        color: #B8860B;
        margin-bottom: 12px;
    }
    
    .quantity-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .quantity-btn {
        width: 40px;
        height: 40px;
        border: none;
        background: #f8f9fa;
        color: #2C3E50;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        transition: all 0.2s ease;
    }
    
    .quantity-btn:hover {
        background: #B8860B;
        color: white;
    }
    
    .quantity-input {
        width: 60px;
        height: 40px;
        text-align: center;
        border: 2px solid #e9ecef;
        border-radius: 8px;
        font-weight: 600;
    }
}

/* Footer Mobile Optimization */
@media (max-width: 768px) {
    .footer {
        padding: 30px 0;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 30px;
    }
    
    .footer-section h5 {
        font-size: 18px;
        margin-bottom: 15px;
        color: #B8860B;
    }
    
    .footer-section ul {
        list-style: none;
        padding: 0;
    }
    
    .footer-section li {
        margin-bottom: 8px;
    }
    
    .footer-section a {
        color: #6c757d;
        text-decoration: none;
        font-size: 14px;
        transition: color 0.3s ease;
    }
    
    .footer-section a:hover {
        color: #B8860B;
    }
    
    .social-links {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin-top: 20px;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
        background: linear-gradient(135deg, #B8860B, #DAA520);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .social-link:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(184, 134, 11, 0.4);
        color: white;
    }
}

/* Loading and Animation Improvements */
@media (max-width: 768px) {
    .loading-skeleton {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
        border-radius: 8px;
    }
    
    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
    
    .fade-in {
        animation: fadeIn 0.6s ease-in-out;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* Safari Mobile Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .form-control, .form-select {
        border-radius: 10px;
        -webkit-appearance: none;
    }
    
    .btn {
        -webkit-appearance: none;
        border-radius: 10px;
    }
    
    /* Fix for iOS Safari zoom on input focus */
    input[type="text"], 
    input[type="email"], 
    input[type="password"], 
    input[type="number"], 
    select, 
    textarea {
        font-size: 16px !important;
    }
}

/* Chrome Mobile Specific Optimizations */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    .product-image img,
    .logo-img,
    .banner-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape Mode Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .main-header {
        padding: 8px 0;
    }
    
    .hero-banner {
        height: 60vh;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Extra Small Devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .product-card {
        margin-bottom: 15px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .form-control {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    h5 { font-size: 14px; }
}

/* Large Mobile Devices (iPhone Plus, etc.) */
@media (min-width: 414px) and (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .hero-banner h1 {
        font-size: 32px;
    }
    
    .hero-banner p {
        font-size: 18px;
    }
}

/* Tablet Portrait Mode */
@media (min-width: 768px) and (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Performance Optimizations */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

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

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    .card, .product-card {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .form-control {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
}

/* Print Styles for Mobile */
@media print {
    .navbar, .footer, .btn, .header-actions {
        display: none !important;
    }
    
    body {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
}