/* ============================================================
   RESPONSIVE DESIGN - ALL PAGES
   Pharmacie Africaine - Mobile-First Approach
   ============================================================ */

:root {
    --primary-color: #2c6e49;
    --primary-dark: #1f5f3f;
    --primary-light: #3d8b5f;
    --accent-orange: #ff6b35;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 4px 15px rgba(44, 110, 73, 0.08);
    --shadow-lg: 0 8px 25px rgba(44, 110, 73, 0.15);
}

/* ============================================================
   BASE & TYPOGRAPHY
   ============================================================ */

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

/* ============================================================
   CONTAINERS & SPACING
   ============================================================ */

.container, .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 576px) {
    .container, .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 992px) {
    .container, .container-fluid {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

/* ============================================================
   NAVBAR - RESPONSIVE
   ============================================================ */

.header {
    z-index: 1000;
}

.header .navbar {
    padding: 0;
}

.header .navbar-nav {
    gap: 0.5rem;
}

@media (max-width: 991px) {
    .header .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow);
    }

    .header .navbar-nav {
        flex-direction: column;
        gap: 0;
    }

    .header .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 576px) {
    .header .search-bar {
        display: none;
    }

    .header .navbar-brand {
        font-size: 1rem;
    }
}

/* ============================================================
   SIDEBAR - RESPONSIVE
   ============================================================ */

#sidebar {
    position: fixed;
    left: 0;
    top: 100px;
    width: 280px;
    height: calc(100vh - 100px);
    z-index: 999;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        left: -100%;
        top: 100px;
        height: auto;
        max-height: calc(100vh - 100px);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
    }

    #sidebar.show {
        left: 0;
    }

    #sidebar::-webkit-scrollbar {
        width: 4px;
    }

    #toggle-sidebar-mobile {
        display: block;
    }
}

@media (max-width: 576px) {
    #sidebar {
        width: 100%;
        position: fixed;
        overflow-y: auto;
    }
}

/* ============================================================
   MAIN CONTENT - RESPONSIVE
   ============================================================ */

main#main {
    margin-left: 280px;
    margin-top: 100px;
    padding: 30px;
    min-height: 100vh;
    background: var(--bg-light);
}

@media (max-width: 768px) {
    main#main {
        margin-left: 0;
        padding: 20px;
    }
}

@media (max-width: 576px) {
    main#main {
        padding: 15px;
        margin-top: 100px;
    }
}

main.main-content {
    margin-top: 200px;
}

@media (max-width: 768px) {
    main.main-content {
        margin-top: 150px;
    }
}

@media (max-width: 576px) {
    main.main-content {
        margin-top: 120px;
    }
}

/* ============================================================
   GRID LAYOUTS - RESPONSIVE
   ============================================================ */

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

@media (max-width: 576px) {
    .row {
        gap: 0.5rem;
        margin-right: -0.5rem;
        margin-left: -0.5rem;
    }
}

/* Col responsive */
.col-12 { width: 100%; }
.col-sm-6 { width: 50%; }
.col-md-4, .col-md-6 { width: 33.333%; }
.col-lg-3, .col-lg-4 { width: 66.333%; }

@media (max-width: 992px) {
    .col-lg-3, .col-lg-4 { width: 50%; }
    .col-md-4 { width: 50%; }
    .col-md-6 { width: 100%; }
}

@media (max-width: 768px) {
    .col-sm-6 { width: 100%; }
    .col-md-4, .col-md-6 { width: 100%; }
    .col-lg-3, .col-lg-4 { width: 50%; }
}

@media (max-width: 576px) {
    [class*="col-"] { width: 100% !important; }
}

/* ============================================================
   CARDS - RESPONSIVE
   ============================================================ */

.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-body {
    padding: 1.25rem;
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }
}

/* ============================================================
   PRODUCT CARDS - RESPONSIVE
   ============================================================ */

.product-card,
.plant-card,
.blog-card,
.consultation-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
}

.product-card:hover,
.plant-card:hover,
.blog-card:hover,
.consultation-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.product-image,
.plant-image,
.blog-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.product-image img,
.plant-image img,
.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img,
.plant-card:hover .plant-image img,
.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.product-info,
.plant-info,
.blog-content {
    padding: 1.25rem;
}

@media (max-width: 576px) {
    .product-image,
    .plant-image,
    .blog-image {
        height: 150px;
    }

    .product-info,
    .plant-info,
    .blog-content {
        padding: 1rem;
    }
}

/* ============================================================
   TABLES - RESPONSIVE
   ============================================================ */

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }

    th {
        background: var(--bg-light);
        font-weight: 600;
    }
}

/* ============================================================
   FORMS - RESPONSIVE
   ============================================================ */

.form-group,
.form-floating {
    margin-bottom: 1rem;
}

.form-control,
.form-select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.1);
    outline: none;
}

@media (max-width: 576px) {
    .form-control,
    .form-select,
    textarea {
        font-size: 16px;
        padding: 0.875rem;
    }
}

/* ============================================================
   BUTTONS - RESPONSIVE
   ============================================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

@media (max-width: 576px) {
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        width: 100%;
    }

    .btn-block {
        width: 100%;
    }
}

/* ============================================================
   PAGINATION - RESPONSIVE
   ============================================================ */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
}

@media (max-width: 576px) {
    .pagination {
        gap: 0.125rem;
    }

    .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* ============================================================
   MODALS - RESPONSIVE
   ============================================================ */

.modal-dialog {
    margin: 1rem auto;
    max-width: 500px;
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: none;
    }

    .modal-content {
        border-radius: 12px 12px 0 0;
        height: auto;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* ============================================================
   ALERTS - RESPONSIVE
   ============================================================ */

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    animation: slideInDown 0.3s ease;
}

@media (max-width: 576px) {
    .alert {
        padding: 0.875rem;
        font-size: 0.875rem;
    }
}

/* ============================================================
   HOMEPAGE SPECIFIC - RESPONSIVE
   ============================================================ */

/* Hero Section Mobile Optimizations */
@media (max-width: 768px) {
    .hero-background {
        background-attachment: scroll;
    }

    .hero-slide {
        background-attachment: scroll;
    }

    .carousel-indicators {
        bottom: 20px;
    }

    .carousel-indicator {
        width: 10px;
        height: 10px;
    }
}

/* Featured Products Grid */
@media (max-width: 768px) {
    .featured-products .row {
        gap: 1rem;
    }

    .product-card {
        margin-bottom: 1rem;
    }

    .product-image {
        height: 200px;
    }

    .product-info {
        padding: 1rem;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-description {
        font-size: 0.85rem;
    }
}

/* Medicinal Plants Grid */
@media (max-width: 768px) {
    .medicinal-plants .row {
        gap: 1rem;
    }

    .plant-card {
        margin-bottom: 1rem;
    }

    .plant-image {
        height: 180px;
    }

    .plant-info {
        padding: 1rem;
    }

    .plant-name {
        font-size: 1rem;
    }

    .plant-usage {
        font-size: 0.85rem;
    }
}

/* Blog Section */
@media (max-width: 768px) {
    .blog-section .row {
        gap: 1rem;
    }

    .blog-card {
        margin-bottom: 1rem;
    }

    .blog-image {
        height: 180px;
    }

    .blog-content {
        padding: 1rem;
    }

    .blog-title {
        font-size: 1.1rem;
    }

    .blog-excerpt {
        font-size: 0.9rem;
    }
}

/* Consultation Cards */
@media (max-width: 768px) {
    .consultation-services .row {
        gap: 1.5rem;
    }

    .consultation-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .consultation-header {
        margin-bottom: 1rem;
    }

    .consultation-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-right: 1rem;
    }

    .consultation-title h4 {
        font-size: 1.1rem;
    }

    .consultation-features {
        margin-bottom: 1rem;
    }

    .price-tag {
        padding: 0.5rem 1rem;
    }

    .price {
        font-size: 1.5rem;
    }
}

/* Features Section */
@media (max-width: 768px) {
    .features-section .row {
        gap: 1rem;
    }

    .feature-card {
        padding: 1.5rem;
        text-align: center;
        margin-bottom: 1rem;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin: 0 auto 1rem;
    }

    .feature-card h5 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .feature-card p {
        font-size: 0.9rem;
    }
}

/* Testimonials */
@media (min-width: 1200px) {
    .testimonials-carousel .row {
        display: flex;
        align-items: stretch;
        justify-content: center;
    }

    .testimonial-card {
        max-width: none;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .testimonials-carousel .row {
        gap: 1rem;
    }

    .testimonial-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
        text-align: center;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .testimonial-text {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    .author-name {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }

    .author-location {
        font-size: 0.85rem;
    }

    .testimonial-author {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .author-avatar {
        width: 70px;
        height: 70px;
        margin-bottom: 0.5rem;
    }

    .author-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border: 3px solid #2c6e49;
    }

    .testimonial-rating {
        margin-bottom: 1.5rem;
    }

    .testimonial-rating i {
        font-size: 1.2rem;
        color: #ffc107;
    }
}

@media (max-width: 576px) {
    .testimonials-section {
        padding: 3rem 0;
    }

    .testimonials-carousel .row {
        gap: 0.75rem;
    }

    .testimonial-card {
        padding: 1.25rem;
        margin-bottom: 0.75rem;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .testimonial-rating {
        justify-content: center;
        margin-bottom: 1rem;
    }

    .testimonial-rating i {
        font-size: 1.1rem;
    }

    .testimonial-text {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }

    .author-name {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
        font-weight: 600;
    }

    .author-location {
        font-size: 0.8rem;
        color: #666;
    }

    .author-avatar {
        width: 60px;
        height: 60px;
        border: 2px solid #2c6e49;
    }

    .author-avatar img {
        border: none;
    }

    .testimonial-author {
        margin-top: 1rem;
    }
}

/* Newsletter Section */
@media (max-width: 768px) {
    .newsletter-section {
        padding: 3rem 0;
    }

    .newsletter-content {
        padding: 2rem 1rem;
        border-radius: 10px;
    }

    .newsletter-text h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .newsletter-text p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .newsletter-form {
        padding: 1.5rem;
    }

    .subscription-form .form-group {
        margin-bottom: 1rem;
    }
}

/* Partners Section */
@media (max-width: 768px) {
    .partners-grid .row {
        gap: 1rem;
    }

    .partner-logo {
        padding: 1rem;
    }

    .partner-logo img {
        max-height: 50px;
    }
}

/* ============================================================
   FOOTER - RESPONSIVE
   ============================================================ */

footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

.footer-top .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-widget {
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.contact-info {
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.contact-item i {
    color: var(--primary-light);
    font-size: 1.1rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.contact-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--white);
}

.footer-links-inline {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links-inline a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-links-inline a:hover {
    color: var(--primary-light);
}

.footer-payment {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.payment-methods {
    display: flex;
    gap: 0.5rem;
}

.payment-method {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 2rem;
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    footer {
        padding: 1.5rem 1rem;
    }

    .footer-top .row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-widget {
        text-align: center;
    }

    .footer-title {
        font-size: 1rem;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links li {
        margin-bottom: 0.75rem;
    }

    .social-links {
        justify-content: center;
    }

    .contact-item {
        justify-content: center;
        text-align: center;
    }

    .footer-links-inline {
        justify-content: center;
        gap: 1rem;
    }

    .footer-payment {
        justify-content: center;
        margin-top: 1rem;
    }
}

@media (max-width: 576px) {
    footer {
        padding: 1rem;
    }

    .footer-top {
        padding-bottom: 1rem;
    }

    .footer-widget h5 {
        font-size: 1rem;
    }

    .footer-links a {
        font-size: 0.85rem;
    }

    .contact-item {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .footer-links-inline {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .footer-links-inline a {
        font-size: 0.8rem;
    }

    .copyright {
        font-size: 0.8rem;
        text-align: center;
    }
}

/* ============================================================
   UTILITIES - RESPONSIVE
   ============================================================ */

.container {
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Visibility utilities */
.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

@media (max-width: 768px) {
    .d-md-none {
        display: none;
    }

    .d-md-block {
        display: block;
    }

    .d-md-flex {
        display: flex;
    }
}

@media (max-width: 576px) {
    .d-sm-none {
        display: none;
    }

    .d-sm-block {
        display: block;
    }

    .d-sm-flex {
        display: flex;
    }

    .mx-auto-sm {
        margin-left: auto;
        margin-right: auto;
    }

    .text-center-sm {
        text-align: center;
    }
}

/* Margin & Padding utilities */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }
.m-5 { margin: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

@media (max-width: 576px) {
    .m-5, .p-5 {
        margin: 1.5rem;
        padding: 1.5rem;
    }

    .m-4, .p-4 {
        margin: 1rem;
        padding: 1rem;
    }

    .m-3, .p-3 {
        margin: 0.75rem;
        padding: 0.75rem;
    }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    body {
        background: white;
    }

    .no-print,
    .navbar,
    .sidebar,
    footer {
        display: none;
    }

    main {
        margin: 0;
        padding: 0;
        background: white;
    }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: more) {
    .card,
    .btn {
        border: 1px solid var(--text-dark);
    }
}
