/* ============================================================
   MedQueretaro - Main Stylesheet
   ============================================================ */

:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --success: #198754;
    --medical-blue: #1a73a7;
    --medical-green: #28a745;
    --body-bg: #f8f9fa;
    --card-shadow: 0 2px 12px rgba(0,0,0,.08);
    --hover-shadow: 0 8px 25px rgba(0,0,0,.12);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* General */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--primary);
    transition: color var(--transition);
}

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

/* Navbar */
.navbar {
    backdrop-filter: blur(10px);
}

.navbar-brand i {
    font-size: 1.3rem;
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: var(--hover-shadow);
    border-radius: 8px;
    animation: fadeInUp 0.2s ease;
}

.navbar .nav-link {
    position: relative;
    transition: color var(--transition);
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition), left var(--transition);
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: 80%;
    left: 10%;
}

/* Search bar */
.navbar .input-group {
    max-width: 300px;
}

.navbar .input-group .form-control {
    border-radius: 20px 0 0 20px;
    border-right: none;
}

.navbar .input-group .btn {
    border-radius: 0 20px 20px 0;
}

/* Hero */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #1a73a7 50%, #198754 100%);
    min-height: 420px;
    position: relative;
    overflow: hidden;
}

.hero-bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%);
    pointer-events: none;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.min-vh-hero { min-height: 380px; }

.hero-search-box {
    max-width: 540px;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.hero-search-box .form-control,
.hero-search-box .input-group-text {
    border: none;
    padding: 0.8rem 1rem;
}

.hero-search-box .btn {
    border-radius: 0;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.hero-float {
    animation: heroFloat 4s ease-in-out infinite;
}

.opacity-85 { opacity: 0.85; }

/* Category Cards - Home */
.category-hover-card {
    transition: transform var(--transition), box-shadow var(--transition);
    border-radius: 12px;
}

.category-hover-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.category-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(13, 110, 253, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition), background var(--transition);
}

.category-hover-card:hover .category-icon-wrap {
    transform: scale(1.1);
    background: rgba(13, 110, 253, 0.15);
}

/* Home Product Cards */
.product-home-card {
    transition: transform var(--transition), box-shadow var(--transition);
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.product-home-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--hover-shadow);
}

.product-home-img {
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-home-card:hover .product-home-img {
    transform: scale(1.06);
}

.product-home-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-home-card:hover .product-home-overlay {
    opacity: 1;
}

/* Rental Cards */
.rental-card {
    transition: transform var(--transition), box-shadow var(--transition);
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.rental-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

/* Review avatar */
.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #6f42c1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Promo banner */
.promo-banner {
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

/* Product Cards */
.product-card {
    transition: transform var(--transition), box-shadow var(--transition);
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--hover-shadow);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 1.25rem;
}

.product-card .product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.product-card .product-price-old {
    font-size: 0.85rem;
    text-decoration: line-through;
    color: #999;
}

.hover-card {
    transition: transform var(--transition), box-shadow var(--transition);
    border-radius: 10px;
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
}

/* Category Cards */
.category-card {
    transition: all var(--transition);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.category-card .icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform var(--transition);
}

.category-card:hover .icon-wrapper {
    transform: scale(1.1);
}

/* Cart */
.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item {
    transition: background var(--transition);
}

.cart-item:hover {
    background: #f8f9fa;
}

/* Checkout */
.form-check.p-3.border:has(input:checked) {
    border-color: var(--primary) !important;
    background-color: #f0f7ff;
}

/* Rental Calendar */
#rental-calendar {
    max-width: 100%;
}

#rental-calendar .fc-daygrid-day.fc-day-today {
    background-color: #e8f4ff;
}

#rental-calendar .fc-event {
    border-radius: 4px;
}

/* Rental cost calculator */
.rental-calculator {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.rental-calculator .total-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

/* Badge styles */
.badge-sm {
    font-size: 0.7rem;
}

.badge {
    font-weight: 500;
}

/* Footer */
footer {
    background: #1a1a2e;
}

footer a {
    transition: color var(--transition), padding-left var(--transition);
}

footer a:hover {
    color: #fff !important;
    padding-left: 3px;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #555;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.35);
}

.btn-lg {
    border-radius: 10px;
    padding: 0.75rem 2rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

/* Tables */
.table th {
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.table-hover tbody tr {
    transition: background var(--transition);
}

/* Stats Cards (used in account dashboard) */
.stat-card {
    border-radius: 12px;
    transition: transform var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Trust badges */
.trust-badge {
    transition: transform var(--transition);
}

.trust-badge:hover {
    transform: translateY(-3px);
}

/* WhatsApp floating button */
.whatsapp-float {
    position: fixed;
    bottom: 75px;
    right: 20px;
    width: 55px;
    height: 55px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: all var(--transition);
    text-decoration: none;
}

.whatsapp-float:hover {
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* Breadcrumbs */
.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
}

/* Alert improvements */
.alert {
    border-radius: 10px;
    border: none;
    border-left: 4px solid;
}

.alert-success { border-left-color: #198754; }
.alert-danger { border-left-color: #dc3545; }
.alert-warning { border-left-color: #ffc107; }
.alert-info { border-left-color: #0dcaf0; }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty states */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        min-height: auto;
    }

    .hero-section .display-4 {
        font-size: 1.8rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .hero-section .d-flex {
        justify-content: center;
    }

    .min-vh-hero {
        min-height: auto;
    }

    .hero-search-box {
        max-width: 100%;
    }

    .product-card .card-img-top,
    .product-home-img {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .navbar .input-group {
        display: none;
    }

    .whatsapp-float {
        bottom: 15px;
        right: 15px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
}

/* Quantity Controls */
.qty-control .form-control {
    border-left: none;
    border-right: none;
    text-align: center;
    -moz-appearance: textfield;
}

.qty-control .form-control::-webkit-inner-spin-button,
.qty-control .form-control::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Image Gallery */
.gallery-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition), opacity var(--transition);
    opacity: 0.7;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: var(--primary);
    opacity: 1;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

/* Pagination */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: none;
    color: #666;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
}

/* Cookie consent */
.cookie-consent {
    backdrop-filter: blur(10px);
    background: rgba(26, 26, 46, 0.95) !important;
}

/* Toast animations */
#toast-container .alert {
    animation: slideIn 0.3s ease;
}

/* Account order history */
.order-timeline {
    position: relative;
    padding-left: 2rem;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.order-timeline-item {
    position: relative;
    margin-bottom: 1rem;
}

.order-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.55rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Accessibility: focus visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: rgba(13, 110, 253, 0.15);
    color: inherit;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Star rating */
.star-rating i {
    transition: color var(--transition), transform var(--transition);
}

.star-rating i:hover {
    transform: scale(1.2);
}

/* Reviews */
.review-list .border-bottom:last-child {
    border-bottom: none !important;
}

/* Scroll to top button */
.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
    z-index: 998;
    cursor: pointer;
    transition: all var(--transition);
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.45);
}

.scroll-top-btn.visible {
    display: flex;
}

/* Wishlist heart animation */
.wishlist-toggle-btn i {
    transition: transform 0.3s ease;
}

.wishlist-toggle-btn:hover i {
    transform: scale(1.2);
}

/* Smooth section transitions */
.section-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Better select styling */
.form-select-sm {
    border-radius: 6px;
}

/* Badge pill improvements */
.badge {
    padding: 0.35em 0.65em;
}

/* Back to top smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Print */
@media print {
    .navbar, footer, .btn, .no-print, .whatsapp-float {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        font-size: 12pt;
    }
}

/* ============================================================
   Auth Pages (Login / Register)
   ============================================================ */

.auth-brand-panel {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #084298 100%);
    position: relative;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.auth-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #f8f9fa 100%);
}

/* Password strength bars */
.strength-bar {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: #e9ecef;
    transition: background var(--transition);
}

.password-strength .strength-label {
    font-size: .8rem;
    display: block;
    margin-top: .25rem;
}

/* ============================================================
   Error Pages
   ============================================================ */

.min-vh-75 { min-height: 75vh; }

.error-illustration {
    position: relative;
    display: inline-block;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: .15;
}

.error-code-danger {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.error-icon-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes errorSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.error-spin {
    animation: errorSpin 4s linear infinite;
}

/* ============================================================
   Footer
   ============================================================ */

.footer-links li { margin-bottom: .5rem; }
.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: .875rem;
    transition: color var(--transition);
}
.footer-links a:hover { color: #fff; }

.footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #4b5563;
    color: #9ca3af;
    text-decoration: none;
    transition: all var(--transition);
}
.footer-social:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
