/* ============================================================
   Professional CSS - R. Pharma Exports
   Designed for Enterprise-Level Pharmaceutical E-Commerce
   ============================================================ */

/* ============================================================
   CSS Variables & Root Styles
   ============================================================ */
:root {
    --primary-color: #0052CC;
    --primary-dark: #003E99;
    --primary-light: #1B7FE5;
    --secondary-color: #06A77D;
    --accent-red: #E63946;
    --accent-gold: #F4A460;
    --accent-purple: #7209B7;
    
    --success-color: #06A77D;
    --warning-color: #F4A460;
    --danger-color: #E63946;
    --info-color: #0052CC;
    
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #999999;
    
    --bg-white: #ffffff;
    --bg-light: #F8F9FA;
    --bg-lighter: #F0F2F5;
    
    --border-color: #E8E8E8;
    --border-light: #F0F0F0;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --spacing-unit: 1rem;
}

/* ============================================================
   Base Styles
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* ============================================================
   Accessibility & Utilities
   ============================================================ */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.text-center {
    text-align: center;
}


/* ============================================================
   Navigation Header
   ============================================================ */
.navbar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    transition: opacity var(--transition-fast);
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    color: white;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
}

/* Ensure toggle sits at the far right of the nav on small screens */
.nav-toggle {
    margin-left: auto;
    align-self: center;
}

/* Force visual order so toggle always appears at the right end
   regardless of DOM order or the nav menu's flex growth */
.nav-wrapper .logo {
    order: 0;
}
.nav-wrapper .nav-menu {
    order: 1;
    flex: 1 1 auto;
    justify-content: center;
}
.nav-wrapper .nav-toggle {
    order: 2;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-gold);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gold);
    border-radius: 2px;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-cart {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cart:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-red);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}


/* ============================================================
   Hero Section
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-purple) 50%, var(--accent-red) 100%);
    color: white;
    padding: 8rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: slideInDown 0.8s ease;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: slideInUp 0.8s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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


/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
    white-space: nowrap;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #058066;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}
/* Featured Products Section */
.featured {
    padding: 5rem 0;
    background: var(--bg-white);
}

.featured h2 {
    font-size: 2.5rem;
}

/* Minimal carousel styles (images + controls) */
.product-image-carousel,
.product-detail-carousel {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-lighter);
    border-radius: var(--radius-md);
}

.product-detail-carousel {
    height: 400px; /* larger on detail view */
}

.product-image-fallback {
    font-size: 3rem;
    color: var(--text-secondary);
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* ensure full image fits the box without distortion */
    display: block;
    transition: opacity 0.3s ease;
    background-color: var(--bg-lighter);
}

/* Ensure Bootstrap carousel elements inside our product image containers fill the available height */
.product-image-carousel .carousel,
.product-image-carousel .carousel-inner,
.product-image-carousel .carousel-item,
.product-image-carousel .carousel-item img,
.product-detail-carousel .carousel,
.product-detail-carousel .carousel-inner,
.product-detail-carousel .carousel-item,
.product-detail-carousel .carousel-item img {
    height: 100% !important;
}

/* Make sure images fill and scale inside the carousel items */
.product-image-carousel .carousel-item img,
.product-detail-carousel .carousel-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.carousel-control.prev { left: 8px; }
.carousel-control.next { right: 8px; }

.carousel-control:focus { outline: 2px solid rgba(255,255,255,0.2); }
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 50%, var(--accent-gold) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    overflow: hidden;
    position: relative;
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.product-card:hover .product-image::before {
    opacity: 1;
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
}

.product-category {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.product-price {
    font-size: 1.5rem;
    color: var(--accent-red);
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-actions .btn {
    flex: 1;
}


/* ============================================================
   Features Section
   ============================================================ */
.features {
    background: var(--bg-light);
    padding: 5rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.feature h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}


/* ============================================================
   Trust Indicators Section
   ============================================================ */
.trust-indicators {
    background: var(--bg-light);
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.indicator-item {
    text-align: center;
    padding: 1rem;
}

.indicator-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.indicator-item p {
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

/* ============================================================
   About Section
   ============================================================ */
.about {
    padding: 5rem 0;
    background: var(--bg-white);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-text strong {
    color: var(--text-primary);
}

/* ============================================================
   CTA Section
   ============================================================ */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-purple) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-section h2 {
    color: white;
    margin-bottom: 1rem;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}


/* ============================================================
   Footer
   ============================================================ */
.footer {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    display: block;
    padding: 0.5rem 0;
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: var(--accent-gold);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* ============================================================
   Modal Styles
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn var(--transition-normal);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp var(--transition-normal);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.cart-total {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}


/* ============================================================
   Responsive Design
   ============================================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .nav-menu {
        gap: 0.5rem;
        font-size: 0.9rem;
        display: none; /* hidden on mobile until toggled */
    }

    .nav-menu.open {
        display: flex;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        padding: 0.5rem 1rem;
        box-shadow: var(--shadow-md);
    }

    .nav-toggle { display: block; }

    .hero {
        padding: 4rem 0;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .products-grid,
    .features-grid,
    .indicators-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature,
    .indicator-item {
        padding: 1rem;
    }

    .featured,
    .features,
    .about,
    .cta-section {
        padding: 3rem 0;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-wrapper {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;
        border-radius: var(--radius-md);
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    .navbar,
    .footer,
    .btn-cart,
    .modal {
        display: none;
    }

    body {
        color: #000;
        background: white;
    }
}
