/* =========================================================
   Cartivous - Professional Medical Theme CSS
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Roboto:wght@500;700&display=swap');

/* --- 1. Variables (Colors & Fonts) --- */
:root {
    --primary-color: #0056b3; /* Medical Blue */
    --secondary-color: #f8f9fa; /* Light Gray Background */
    --accent-color: #ff9900; /* Action/Reward Orange */
    --text-dark: #333333;
    --text-muted: #666666;
    --rx-color: #d9534f; /* Alert Red */
    --success-color: #28a745;
    --border-color: #e0e0e0;
}

/* --- 2. Base & Reset --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Open Sans', sans-serif; 
    color: var(--text-dark); 
    background-color: var(--secondary-color); 
    line-height: 1.6; 
    overflow-x: hidden; /* Mobile par screen se bahar jane se rokta hai */
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 15px; 
}

/* Typography */
.section-title { 
    font-family: 'Roboto', sans-serif; 
    font-size: 28px; 
    color: var(--text-dark); 
    border-bottom: 2px solid var(--border-color); 
    padding-bottom: 10px; 
    margin-bottom: 30px; 
}

/* Buttons */
.btn { 
    display: inline-block; 
    padding: 12px 24px; 
    font-weight: 600; 
    text-align: center; 
    text-decoration: none; 
    border-radius: 4px; 
    cursor: pointer; 
    border: none; 
    transition: background-color 0.3s, transform 0.2s; 
}
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: #004494; }
.btn-accent { background-color: var(--accent-color); color: #fff; }
.btn-accent:hover { background-color: #e68a00; }

/* --- 3. Header & Navigation --- */
.site-header { 
    background: #fff; 
    border-bottom: 2px solid var(--primary-color); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
}
.header-main { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 20px; 
    max-width: 1200px; 
    margin: auto; 
}

/* Header Columns */
.header-left { flex: 1; display: flex; align-items: center; }
.header-center { flex: 1; text-align: center; }
.header-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 20px; }

.logo-area a { 
    font-size: 28px; 
    font-weight: 700; 
    color: var(--primary-color); 
    text-decoration: none; 
    font-family: 'Roboto', sans-serif; 
    letter-spacing: -0.5px;
}

/* Header Icons */
.icon-btn { 
    font-size: 22px; 
    color: #333; 
    text-decoration: none; 
    cursor: pointer; 
    background: none; 
    border: none; 
    position: relative; 
    display: flex; 
    align-items: center;
}
.icon-btn:hover { color: var(--accent-color); }
.badge { 
    position: absolute; 
    top: -8px; 
    right: -10px; 
    background: var(--rx-color); 
    color: white; 
    font-size: 11px; 
    font-weight: bold; 
    padding: 2px 6px; 
    border-radius: 50%; 
}

/* Slide-out Side Menu */
.side-menu { 
    position: fixed; 
    top: 0; 
    left: -320px; 
    width: 280px; 
    height: 100vh; 
    background: #fff; 
    box-shadow: 5px 0 15px rgba(0,0,0,0.1); 
    z-index: 2000; 
    transition: 0.3s; 
    padding: 20px; 
    overflow-y: auto; 
}
.side-menu.active { left: 0; }
.menu-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    z-index: 1500; 
    display: none; 
}
.menu-overlay.active { display: block; }
.close-btn { 
    font-size: 28px; 
    background: none; 
    border: none; 
    cursor: pointer; 
    color: #333; 
    float: right; 
    margin-bottom: 10px; 
}
.side-menu ul { list-style: none; padding: 0; clear: both; }
.side-menu ul li { margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.side-menu ul li a { text-decoration: none; color: #333; font-size: 16px; font-weight: bold; display: block; }
.side-menu ul li a:hover { color: var(--primary-color); }
.menu-label { font-size: 12px; color: #999; text-transform: uppercase; margin-top: 20px; margin-bottom: 10px; font-weight: bold;}

/* Search Dropdown */
.search-drop { 
    display: none; 
    position: absolute; 
    top: 60px; 
    right: 20px; 
    background: white; 
    padding: 10px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    border-radius: 4px; 
    z-index: 1000; 
    width: 250px;
}
.search-drop.active { display: flex; }
.search-drop input { flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 4px 0 0 4px; }
.search-drop button { background: var(--primary-color); color: white; border: none; padding: 8px 15px; border-radius: 0 4px 4px 0; cursor: pointer;}


/* --- 4. Main Layout Grids (Desktop First) --- */

/* Value Cards (Best Price, Shipping etc.) */
.value-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; 
    margin: 50px 0; 
}
.value-card { 
    background: #fff; 
    padding: 25px; 
    border-radius: 12px; 
    border: 1px solid #ddd; 
    text-align: center; 
    transition: box-shadow 0.3s;
}
.value-card:hover { box-shadow: 0 8px 15px rgba(0,0,0,0.05); }

/* Product Grid & Cards */
.product-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; 
    margin-bottom: 50px; 
}
.product-card { 
    background: #fff; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    padding: 20px; 
    text-align: center; 
    transition: transform 0.2s, box-shadow 0.2s; 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    height: 100%;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.product-card img { width: 100%; height: 200px; object-fit: contain; margin-bottom: 15px; }

/* Truncate long product names to 2 lines max */
.product-card h3 { 
    font-size: 15px; 
    font-weight: 600; 
    margin-bottom: 10px; 
    line-height: 1.3; 
    overflow: hidden; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
}
.product-price { font-size: 20px; font-weight: 700; color: var(--primary-color); margin-bottom: 15px; }
.rx-tag { position: absolute; top: 15px; left: 15px; background: var(--rx-color); color: white; font-size: 11px; font-weight: bold; padding: 4px 8px; border-radius: 3px; text-transform: uppercase; }

/* Blog Grid */
.blog-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
    margin-bottom: 50px; 
}
.blog-card { 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    overflow: hidden; 
    background: #fff; 
    display: flex; 
    flex-direction: column;
}
.blog-card img { width: 100%; height: 200px; object-fit: cover; border-bottom: 1px solid #eee; }
.blog-info { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }


/* --- 5. Checkout & Forms --- */
.checkout-grid { 
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    gap: 30px; 
    margin-top: 40px; 
    align-items: start;
}
input[type="text"], input[type="email"], input[type="number"], input[type="tel"], input[type="password"], textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Open Sans', sans-serif;
    box-sizing: border-box;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
}


/* --- 6. Footer --- */
.site-footer { 
    background: #232f3e; 
    color: #ffffff; 
    padding: 50px 0 20px; 
    margin-top: 60px; 
    font-size: 14px;
}
.footer-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px; 
    margin-bottom: 40px; 
}
.footer-col h4 { font-family: 'Roboto', sans-serif; font-size: 18px; margin-bottom: 20px; color: #fff; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #cccccc; text-decoration: none; transition: 0.3s; }
.footer-col a:hover { color: var(--accent-color); }
.footer-bottom { border-top: 1px solid #3a4553; padding-top: 20px; text-align: center; color: #999; }


/* =========================================================
   7. MOBILE RESPONSIVE QUERIES (Fixes screen overflow & Layouts)
   ========================================================= */

/* Tablet & Smaller Desktop View */
@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .checkout-grid { grid-template-columns: 1fr; } /* Tablet par checkout stack ho jayega */
}

/* Mobile View (Phones) */
@media (max-width: 768px) {
    /* Header Fixes */
    .header-main { padding: 10px 15px; }
    .logo-area a { font-size: 22px; }
    
    /* Grid Adjustments */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    /* IMPORTANT FIX: Mobile par Value cards 2x2 grid me dikhenge */
    .value-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 15px !important; margin: 30px 0; } 
    .value-card { padding: 15px 10px; }
    .value-card h3 { font-size: 14px !important; }
    .value-card p { font-size: 11px !important; }
    
    .blog-grid { grid-template-columns: 1fr; gap: 20px; }
    
    /* Footer Adjustments */
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    
    /* Typography & Spacing */
    .section-title { font-size: 22px; margin-bottom: 20px; }
    
    /* Product Card Mobile Adjustments */
    .product-card { padding: 10px; }
    .product-card img { height: 150px; margin-bottom: 10px; }
    .product-card h3 { font-size: 13px; }
    .product-price { font-size: 16px; }
    .btn { padding: 10px 15px; font-size: 14px; }
}

/* Extra Small Phones */
@media (max-width: 480px) {
    /* Bahut chote screen par bhi value cards 2x2 rahenge */
    .value-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    
    .product-grid { grid-template-columns: 1fr; } /* 1 product per row */
    .footer-grid { grid-template-columns: 1fr; text-align: center; } /* Footer center align */
    .product-card img { height: auto; max-height: 200px; }
}
