/* =============================================
   style.css — PetsHeaven (FINAL WORKING VERSION)
   ============================================= */

:root {
    --primary:    #667eea;
    --secondary:  #764ba2;
    --dark:       #333333;
    --light:      #f8f9fa;
    --white:      #ffffff;
    --danger:     #dc3545;
    --success:    #28a745;
    --transition: all 0.3s ease;
    --shadow:     0 5px 20px rgba(0,0,0,0.08);
    --radius:     12px;
}

/* ===== Base Styles ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { 
    scroll-behavior: smooth;
    overflow-y: visible;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    color: var(--dark);
    background: var(--white);
    line-height: 1.6;
    overflow-x: clip;
}
img { max-width:100%; display:block; }
a { text-decoration:none; color:inherit; }
ul { list-style:none; }

/* ===== Container ===== */
.container { width:100%; max-width:1200px; margin:0 auto; padding:0 20px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary { background:var(--primary); color:white; border-color:var(--primary); }
.btn-primary:hover { background:#5a6fd8; border-color:#5a6fd8; transform:translateY(-2px); box-shadow:0 4px 12px rgba(102,126,234,0.35); }
.btn-outline { background:transparent; color:var(--primary); border-color:var(--primary); }
.btn-outline:hover { background:var(--primary); color:white; }
.btn-white { background:white; color:var(--primary); border-color:white; }
.btn-white:hover { background:transparent; color:white; border-color:white; }
.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition);
    flex-shrink: 0;
    touch-action: manipulation;
}
.btn-share:hover { background:var(--primary); color:white; }

/* ===== Layout ===== */
.section-padding { padding: 70px 0; }
.bg-light { background: var(--light); }
.section-header { text-align:center; margin-bottom:40px; }
.section-title { font-size:32px; font-weight:700; color:var(--dark); margin-bottom:10px; }
.section-subtitle { color:#777; font-size:16px; }
.text-center { text-align:center; }
.mt-4 { margin-top:24px; }

/* ===== Alerts ===== */
.alert { padding:14px 20px; border-radius:8px; margin-bottom:20px; font-size:14px; }
.alert-success { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.alert-error   { background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; }
.alert ul { list-style:none; padding:0; }

/* ===== Navigation - Desktop Styles (ADDED FROM PURANA CODE) ===== */
.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary);
    padding: 8px;
    touch-action: manipulation;
}

.auth-buttons-mobile {
    display: none;
}

.menu-overlay {
    display: none;
}

/* ===== HERO SLIDER ===== */
.hero {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
}

.slides-container {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.slide.active { opacity:1; z-index:2; }

.overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none !important;
}
.overlay-gradient {
    background: linear-gradient(135deg, rgba(102,126,234,0.55), rgba(118,75,162,0.55));
}
.overlay-darker {
    background: linear-gradient(135deg, rgba(26,26,46,0.65), rgba(118,75,162,0.65));
}

.hero-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    text-align: center;
    color: white;
    width: 90%;
    max-width: 700px;
    pointer-events: none;
}
.hero-content * { pointer-events: auto; }

.hero-content h1 { font-size:52px; font-weight:800; margin-bottom:16px; line-height:1.2; text-shadow:0 2px 10px rgba(0,0,0,0.3); }
.hero-content p { font-size:18px; margin-bottom:28px; opacity:0.95; }

.slider-arrow {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    z-index: 5;
    background: rgba(255,255,255,0.25);
    border: 2px solid rgba(255,255,255,0.6);
    color: white;
    width: 48px; height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    touch-action: manipulation;
}
.slider-arrow:hover { background:white; color:var(--primary); }
.slider-arrow.prev { left:20px; }
.slider-arrow.next { right:20px; }

.slider-dots {
    position: absolute;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex; gap: 8px;
}
.dot {
    width:10px; height:10px;
    border-radius:50%;
    background:rgba(255,255,255,0.5);
    cursor:pointer;
    transition:var(--transition);
    touch-action:manipulation;
}
.dot.active, .dot:hover { background:white; transform:scale(1.3); }

/* ===== CLINIC & RATING SLIDERS ===== */
.clinic-slider,
.rating-slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.overlay-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    text-align: center;
    color: white;
    width: 90%; max-width: 650px;
    pointer-events: none;
}
.overlay-content * { pointer-events: auto; }
.overlay-content .section-title { color:white; }
.overlay-content p { font-size:16px; opacity:0.9; margin-bottom:20px; }

.rating-stats { margin-top:20px; }
.overall-rating { margin-bottom:20px; }
.big-rating { font-size:64px; font-weight:800; color:white; line-height:1; }
.out-of { font-size:24px; color:rgba(255,255,255,0.8); }
.overall-rating p { color:rgba(255,255,255,0.85); font-size:14px; margin-top:6px; }

/* ===== PRODUCT CARDS (FROM NEW CODE) ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.product-card:hover { transform:translateY(-6px); box-shadow:0 12px 30px rgba(0,0,0,0.13); }

.product-image { position:relative; height:200px; overflow:hidden; }
.product-image img { width:100%; height:100%; object-fit:cover; transition:transform 0.5s ease; }
.product-card:hover .product-image img { transform:scale(1.08); }

.product-badges { position:absolute; top:10px; left:10px; display:flex; flex-direction:column; gap:5px; z-index:2; }
.badge { padding:4px 10px; border-radius:20px; font-size:12px; font-weight:700; }
.badge.discount { background:var(--danger); color:white; }

.product-info { padding:18px; }
.product-info h3 { font-size:15px; font-weight:600; margin-bottom:10px; color:var(--dark); line-height:1.4; }

.product-price { margin-bottom:14px; }
.original-price { text-decoration:line-through; color:#999; font-size:13px; margin-right:6px; }
.discounted-price, .price { font-size:18px; font-weight:700; color:var(--primary); }

.product-actions { display:flex; align-items:center; gap:10px; }
.product-actions .btn-primary { flex:1; font-size:13px; padding:10px 12px; }

/* ===== GALLERY ===== */
.gallery-grid { display:grid; grid-template-columns:repeat(4,1fr); grid-auto-rows:200px; gap:14px; }
.gallery-item { position:relative; overflow:hidden; border-radius:10px; cursor:pointer; }
.gallery-item.wide { grid-column:span 2; }
.gallery-item.tall { grid-row:span 2; }
.gallery-item img { width:100%; height:100%; object-fit:cover; transition:transform 0.5s ease; }
.gallery-item:hover img { transform:scale(1.08); }
.gallery-overlay { position:absolute; inset:0; background:rgba(102,126,234,0.6); display:flex; align-items:center; justify-content:center; opacity:0; transition:var(--transition); }
.gallery-item:hover .gallery-overlay { opacity:1; }
.gallery-overlay h3 { color:white; font-size:16px; font-weight:600; text-align:center; padding:10px; }

/* ===== NEWS ===== */
.news-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.news-card { background:white; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); transition:var(--transition); }
.news-card:hover { transform:translateY(-4px); box-shadow:0 10px 25px rgba(0,0,0,0.12); }
.news-image { width:100%; height:180px; object-fit:cover; }
.news-content { padding:20px; }
.news-date { font-size:12px; color:#999; display:block; margin-bottom:8px; }
.news-content h3 { font-size:16px; font-weight:600; margin-bottom:10px; line-height:1.4; }
.news-content p { font-size:14px; color:#666; margin-bottom:14px; line-height:1.6; }
.read-more { color:var(--primary); font-size:13px; font-weight:600; display:inline-flex; align-items:center; gap:5px; transition:var(--transition); }
.read-more:hover { gap:10px; }

/* ===== TESTIMONIALS ===== */
.rating-collection-grid { display:grid; grid-template-columns:1fr 1fr; gap:40px; align-items:start; }
.half-title { font-size:20px; font-weight:700; margin-bottom:20px; color:var(--dark); }
.testimonials-grid-half { display:flex; flex-direction:column; gap:16px; }
.testimonial-card { background:white; padding:20px; border-radius:var(--radius); box-shadow:var(--shadow); border-left:4px solid var(--primary); }
.testimonial-header { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.testimonial-avatar { width:48px; height:48px; border-radius:50%; background:var(--primary); color:white; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; flex-shrink:0; }
.testimonial-header h4 { font-size:15px; font-weight:600; margin-bottom:4px; }
.rating i { color:#ffc107; font-size:13px; }
.testimonial-text { font-size:14px; color:#555; line-height:1.6; font-style:italic; }
.rating-form-card { background:white; padding:28px; border-radius:var(--radius); box-shadow:var(--shadow); }
.form-group { margin-bottom:18px; }
.form-group label { display:block; font-size:14px; font-weight:600; margin-bottom:8px; color:var(--dark); }
.form-group textarea { width:100%; padding:12px; border:1.5px solid #e0e0e0; border-radius:8px; font-size:14px; font-family:inherit; resize:vertical; min-height:110px; transition:var(--transition); }
.form-group textarea:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(102,126,234,0.15); }
.star-rating { display:flex; flex-direction:row-reverse; gap:4px; justify-content:flex-end; }
.star-rating input[type="radio"] { display:none; }
.star-rating label { font-size:30px; color:#ddd; cursor:pointer; transition:color 0.2s; margin:0; font-weight:normal; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color:#ffc107; }
.login-prompt { text-align:center; padding:20px 0; color:#666; font-size:15px; line-height:2; }
.login-prompt a { color:var(--primary); font-weight:600; }

/* ==============================================
   MOBILE RESPONSIVE (max-width: 768px)
   COMBINED FROM BOTH CODES - BEST OF BOTH
   ============================================== */
@media (max-width: 768px) {
    /* ===== SIDEBAR STYLES (FROM PURANA CODE - WORKING) ===== */
    .main-nav {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 80% !important;
        max-width: 300px !important;
        height: 100vh !important;
        background: white !important;
        z-index: 9999 !important;
        padding: 80px 20px 40px !important;
        overflow-y: auto !important;
        transition: left 0.3s ease !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15) !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .main-nav.active { left: 0 !important; }

    .main-nav ul {
        flex-direction: column !important;
        gap: 4px !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    .main-nav ul li {
        width: 100% !important;
    }

    .main-nav ul li a {
        display: block !important;
        padding: 14px 16px !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        color: #333 !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        /* CRITICAL - FROM PURANA CODE */
        pointer-events: auto !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(102,126,234,0.15) !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 10000 !important;  /* YAHI SE FIX HUA SIDEBAR */
        width: 100% !important;
    }

    .main-nav ul li a:active,
    .main-nav ul li a.active {
        background: rgba(102,126,234,0.12) !important;
        color: var(--primary) !important;
    }

    /* Hide desktop auth buttons */
    .auth-buttons { display: none !important; }

    /* Show mobile auth buttons */
    .auth-buttons-mobile {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        margin-top: 24px !important;
        padding-top: 20px !important;
        border-top: 1px solid #eee !important;
        width: 100% !important;
    }

    .auth-buttons-mobile a {
        display: block !important;
        padding: 13px 16px !important;
        text-align: center !important;
        border-radius: 8px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        cursor: pointer !important;
    }

    /* Overlay */
    .menu-overlay {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0,0,0,0.55) !important;
        z-index: 9998 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.3s ease !important;
        pointer-events: auto important;
    }
    
    .menu-overlay.active {
        opacity: 1 important;
        visibility: visible important;
        pointer-events: auto important;
    }

    .mobile-menu-toggle {
        display: flex !important;
        z-index: 10001 !important;
        position: relative !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }

    /* ===== PAGE SECTIONS (FROM NEW CODE - WORKING PRODUCTS) ===== */
    .hero { height: 420px; }
    .hero-content h1 { font-size: 30px; }
    .hero-content p { font-size: 15px; }
    .clinic-slider, .rating-slider { height: 400px; }

    /* Products grid - 2 columns (FROM NEW CODE) */
    .products-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 14px !important; 
    }
    .product-image { height: 150px; }
    .product-info { padding: 14px; }
    .product-actions .btn-primary { font-size: 12px; padding: 9px 10px; }

    .news-grid { grid-template-columns: 1fr; }

    .gallery-grid { 
        grid-template-columns: repeat(2,1fr) !important; 
        grid-auto-rows:140px !important; 
    }
    .gallery-item.wide, .gallery-item.tall { grid-column:auto; grid-row:auto; }

    .rating-collection-grid { grid-template-columns: 1fr; gap: 24px; }

    .section-title { font-size: 24px; }
    .section-padding { padding: 48px 0; }

    .slider-arrow { width:38px; height:38px; font-size:13px; }
    .slider-arrow.prev { left:10px; }
    .slider-arrow.next { right:10px; }

    .big-rating { font-size: 48px; }
}

/* ===== Extra Small Mobile (max-width: 480px) ===== */
@media (max-width: 480px) {
    .hero { height: 360px; }
    .hero-content h1 { font-size: 26px; }
    .products-grid { grid-template-columns: 1fr !important; }
    .rating-form-card { padding: 20px; }
}

/* ===== Tablet Landscape (769px to 992px) ===== */
@media (min-width: 769px) and (max-width: 992px) {
    .products-grid { grid-template-columns: repeat(2,1fr); }
    .news-grid { grid-template-columns: repeat(2,1fr); }
    .gallery-grid { grid-template-columns: repeat(3,1fr); }
}