/* Custom CSS for MP Mobile */

/* Utilities */
.lazy {
    filter: blur(5px);
    transition: filter 0.3s;
}

.lazy.loaded {
    filter: blur(0);
}

/* Condition badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background-color: #10b981;
    color: white;
}

.badge-primary {
    background-color: #3b82f6;
    color: white;
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
}

.badge-secondary {
    background-color: #6b7280;
    color: white;
}

.badge-light {
    background-color: #f3f4f6;
    color: #374151;
}

/* Product cards */
.product-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-image {
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* Mobile optimizations for product cards */
@media (max-width: 640px) {
    .product-card {
        border-radius: 0.5rem;
    }
    
    .product-card .product-image {
        aspect-ratio: 1/1;
        object-fit: cover;
    }
    
    /* Compact text on mobile */
    .product-card h3 {
        font-size: 0.75rem;
        line-height: 1.2;
        min-height: 32px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Price optimization */
    .product-card .price-save {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    /* Button optimization */
    .product-card a[class*="bg-blue"] {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Price styling */
.price-original {
    text-decoration: line-through;
    color: #9ca3af;
}

.price-offer {
    color: #059669;
    font-weight: 700;
}

.price-save {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Search filters */
.filter-section {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #374151;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-checkbox {
    margin-right: 0.75rem;
}

/* Hero section */
.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* AdSense containers */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    min-height: 100px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.ad-container::before {
    content: 'Advertisement';
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive improvements */
@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    /* Compact container padding on mobile */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Better text readability on small screens */
    body {
        font-size: 14px;
    }
    
    /* Smaller headings on mobile */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1rem;
    }
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Comparison table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.comparison-table tr:hover {
    background-color: #f9fafb;
}

/* Form styling */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-success {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Button variations */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background-color: #f9fafb;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #9ca3af;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background-color: #10b981;
}

.toast-error {
    background-color: #dc2626;
}

.toast-warning {
    background-color: #f59e0b;
}

/* Image gallery */
.image-gallery {
    position: relative;
}

.gallery-main {
    aspect-ratio: 4/3;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.gallery-thumb {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    border-radius: 0.375rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
}

.gallery-thumb.active {
    border-color: #3b82f6;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Description Formatting - SEO Friendly */
.product-description {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

.product-description h1,
.product-description h2,
.product-description h3,
.product-description h4,
.product-description h5,
.product-description h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1f2937;
}

.product-description h1 {
    font-size: 1.875rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.product-description h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 0.375rem;
}

.product-description h3 {
    font-size: 1.25rem;
}

.product-description h4 {
    font-size: 1.125rem;
}

.product-description h5,
.product-description h6 {
    font-size: 1rem;
}

.product-description p {
    margin-bottom: 1rem;
}

.product-description strong,
.product-description b {
    font-weight: 600;
    color: #111827;
}

.product-description em,
.product-description i {
    font-style: italic;
}

.product-description ul,
.product-description ol {
    margin: 1rem 0 1rem 1.5rem;
    padding: 0;
}

.product-description ul {
    list-style-type: disc;
}

.product-description ol {
    list-style-type: decimal;
}

.product-description li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.product-description ul ul,
.product-description ol ul {
    list-style-type: circle;
    margin-top: 0.5rem;
}

.product-description ol ol,
.product-description ul ol {
    list-style-type: lower-alpha;
    margin-top: 0.5rem;
}

.product-description a {
    color: #3b82f6;
    text-decoration: underline;
}

.product-description a:hover {
    color: #2563eb;
}

.product-description blockquote {
    border-left: 4px solid #3b82f6;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background-color: #f9fafb;
    font-style: italic;
    color: #4b5563;
}

.product-description code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    color: #dc2626;
}

.product-description pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.product-description pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* First heading style optimization */
.product-description > h2:first-child,
.product-description > h3:first-child {
    margin-top: 0;
}

/* Last paragraph margin fix */
.product-description > p:last-child {
    margin-bottom: 0;
}

/* Mobile optimization for description */
@media (max-width: 640px) {
    .product-description {
        font-size: 14px;
    }
    
    .product-description h1 {
        font-size: 1.5rem;
    }
    
    .product-description h2 {
        font-size: 1.25rem;
    }
    
    .product-description h3 {
        font-size: 1.125rem;
    }
    
    .product-description h4,
    .product-description h5,
    .product-description h6 {
        font-size: 1rem;
    }
}

/* Navigation dropdown styles */
.group:hover .group-hover\:visible {
    visibility: visible;
    opacity: 1;
}

/* Mobile navigation improvements */
@media (max-width: 768px) {
    /* Hide desktop navigation */
    .hidden.md\:flex {
        display: none !important;
    }
    
    /* Show mobile menu button */
    .md\:hidden {
        display: block !important;
    }
    
    /* Mobile menu styles */
    #mobile-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }
    
    #mobile-menu:not(.hidden) {
        max-height: 500px;
    }
    
    /* Better touch targets */
    #mobile-menu a {
        padding: 12px 16px;
        display: block;
        font-size: 16px;
    }
    
    /* Mobile header padding */
    header .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Cart icon on mobile */
    .md\:block {
        display: none !important;
    }
}

/* Dropdown z-index fix */
.group .absolute {
    z-index: 50;
}

/* Better hover states for touch devices */
@media (hover: none) {
    .group:active .group-hover\:visible {
        visibility: visible;
        opacity: 1;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .product-description {
        page-break-inside: avoid;
    }
}
