/* Affiliate Shops Frontend Styles */

/* Global Color Override - Replace Bootstrap Blue with Our Green */
:root {
    --bs-primary: #59AC6F !important;
    --bs-primary-rgb: 89, 172, 111 !important;
}

/* Override Bootstrap Primary Color Classes */
.btn-primary {
    background-color: #59AC6F !important;
    border-color: #59AC6F !important;
}

.btn-primary:hover {
    background-color: #4a9060 !important;
    border-color: #4a9060 !important;
}

.btn-primary:focus {
    background-color: #4a9060 !important;
    border-color: #4a9060 !important;
    box-shadow: 0 0 0 0.2rem rgba(89, 172, 111, 0.5) !important;
}

.text-primary {
    color: #59AC6F !important;
}

.text-primary:hover {
    color: #4a9060 !important;
}

a {
    color: #59AC6F;
}

a:hover {
    color: #4a9060;
}

/* Dropdown Button Styling */
.btn.dropdown-toggle {
    background-color: #59AC6F !important;
    border-color: #59AC6F !important;
    color: white !important;
}

.btn.dropdown-toggle:hover {
    background-color: #4a9060 !important;
    border-color: #4a9060 !important;
}

.btn.dropdown-toggle:focus {
    background-color: #4a9060 !important;
    border-color: #4a9060 !important;
    box-shadow: 0 0 0 0.2rem rgba(89, 172, 111, 0.25) !important;
}

/* Spinner Color Override */
.spinner-border {
    color: #59AC6F !important;
}

/* Global Button Styles - Sharp Corners */
.btn, 
.btn-primary, 
.btn-secondary, 
.btn-success, 
.btn-warning, 
.btn-outline-primary, 
.btn-outline-secondary, 
.btn-outline-light, 
.btn-outline-dark {
    border-radius: 0 !important;
}

/* Hero Section Styles */
.hero-section {
    position: relative;
    overflow: hidden;
    background-attachment: fixed !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
}

.hero-overlay {
    z-index: 1;
}

.hero-section .container-fluid {
    position: relative;
    z-index: 2;
}

.hero-underline {
    background: #ffc107 !important;
    height: 4px !important;
    width: 250px !important;
    border-radius: 2px;
}

/* Features Section Styles */
.features-section {
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.feature-item {
    padding: 1rem;
}

.feature-icon {
    min-width: 60px;
    text-align: center;
}

.feature-content h5 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.feature-content p {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Help us, by shopping Section Styles */
.help-shopping-section {
    background-color: #f8f9fa !important;
}

.help-shopping-section h2 {
    color: #333333 !important;
    font-weight: 700 !important;
    font-size: 2.5rem !important;
}

.help-underline {
    background: #59AC6F !important;
    height: 3px !important;
    width: 452px !important;
    border-radius: 2px !important;
 
}

.help-shop-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0 !important;
    background: #F5F5F5 !important;
}

.help-shop-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
}

.shop-logo-container {
    height: 120px !important;
    background: #f8f9fa !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow: hidden !important;
}

.shop-logo-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.help-shop-card .card-body {
    padding: 0 !important;
}

.help-shop-card .card-title {
    color: #333333 !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
}

.help-shop-card .btn-success {
    background: #59AC6F !important;
    border: none !important;
    border-radius: 0 !important;
    font-weight: 600 !important;
    padding: 0.5rem 1.5rem !important;
    font-size: 0.95rem !important;
}

.help-shop-card .btn-success:hover {
    background: #218838 !important;
    transform: translateY(-2px);
}

/* Additional Sections Styles */
.additional-sections {
    background-color: #f8f9fa !important;
}

.additional-sections h2 {
    color: #333333 !important;
    font-weight: 700 !important;
    font-size: 2rem !important;
}

.section-underline {
    background: #59AC6F !important;
    height: 4px !important;
    width: 80px !important;
    border-radius: 2px !important;
}

.additional-sections p {
    color: #6c757d !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

.additional-sections img {
    max-height: 200px !important;
    object-fit: contain !important;
    width: auto !important;
}

.additional-sections .row {
    align-items: center;
}

/* Responsive Design Improvements */
@media (max-width: 767px) {
    .hero-section {
        min-height: 350px !important;
        background-attachment: scroll !important;
    }
    
    .hero-section .display-4 {
        font-size: 2rem !important;
    }
    
    .hero-section .lead {
        font-size: 1rem !important;
    }
    
    .hero-underline {
        width: 150px !important;
    }
    
    .feature-item {
        margin-bottom: 1rem;
    }
    
    .feature-item .d-flex {
        justify-content: flex-start !important;
    }
    
    /* Help shopping section mobile styles */
    .help-shopping-section h2 {
        font-size: 2rem !important;
    }
    
    .help-shopping-section .lead {
        font-size: 1rem !important;
    }
    
    .help-underline {
        width: 80px !important;
    }
    
    .help-shop-card {
        margin-bottom: 1.5rem;
    }
    
    .shop-logo-container {
        height: 100px !important;
        padding: 8px !important;
    }
    
    .shop-logo-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
    
    .help-shop-card .card-title {
        font-size: 1.1rem !important;
    }
    
    /* Additional sections mobile styles */
    .additional-sections h2 {
        font-size: 1.5rem !important;
        text-align: center;
    }
    
    .additional-sections .section-underline {
        margin: 0 auto 1rem auto !important;
        width: 60px !important;
    }
    
    .additional-sections p {
        text-align: center;
        font-size: 0.9rem !important;
    }
    
    .additional-sections img {
        max-height: 150px !important;
        margin-bottom: 1rem;
    }
    
    .additional-sections .col-lg-6 {
        text-align: center !important;
    }
    
    .as-filters-sidebar {
        margin-bottom: 2rem;
    }
    
    .filter-group {
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 575px) {
    .hero-section {
        min-height: 300px !important;
    }
    
    .hero-section .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .btn-lg {
        font-size: 0.9rem !important;
        padding: 0.7rem 1.2rem !important;
    }
    
    .display-4 {
        font-size: 1.75rem !important;
    }
    
    .lead {
        font-size: 0.9rem !important;
    }
    
    .hero-underline {
        width: 120px !important;
        height: 3px !important;
    }
    
    .features-section .col-md-4 {
        border-bottom: 1px solid #e9ecef;
    }
    
    .features-section .col-md-4:last-child {
        border-bottom: none;
    }
    
    /* Ensure full-width images on very small screens */
    .shop-logo-container {
        height: 80px !important;
        padding: 5px !important;
    }
    
    .shop-logo-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
}

/* General Loading State */
.as-loading {
    cursor: wait;
}

.as-loading * {
    pointer-events: none;
}

/* Loading Skeleton Animation */
.shop-skeleton {
    padding: 20px;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    background-color: #e9ecef;
    border-radius: 8px;
}

.skeleton-line {
    height: 16px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 200px;
}

.skeleton-subtitle {
    height: 14px;
    width: 150px;
}

.skeleton-card {
    height: 120px;
    background-color: #e9ecef;
    border-radius: 8px;
}

/* Improved loading animations */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shop Logo Styling */
.shop-logo-container {
    flex-shrink: 0;
}

.shop-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    object-position: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 4px;
    transition: transform 0.2s ease;
}

.shop-logo:hover {
    transform: scale(1.05);
    border-color: #dee2e6;
}

/* Product and Banner Image Optimization */
.product-image {
    height: 100px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.2s ease;
}

.product-card-optimized:hover .product-image {
    transform: scale(1.02);
}

.banner-image {
    max-height: 150px;
    object-fit: cover;
    object-position: center;
}

/* Responsive adjustments for logos */
@media (max-width: 768px) {
    .shop-logo {
        width: 60px;
        height: 60px;
    }
    
    .shop-logo-container {
        margin-bottom: 10px;
    }
    
    .shop-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

@media (max-width: 576px) {
    .shop-logo {
        width: 50px;
        height: 50px;
    }
}

/* Shop Details Fade Animation */
#shopDetailsContainer {
    transition: opacity 0.3s ease-in-out;
}

/* Card Hover Effects */
.product-card-optimized {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card-optimized:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-optimized {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.banner-optimized:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Shop Directory Styles */
.as-shop-directory {
    min-height: 600px;
}

.as-filters-sidebar {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group .form-label {
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Dropdown Enhancements */
.dropdown-toggle {
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.dropdown-toggle:hover:not(.disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-toggle:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.dropdown-toggle.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.dropdown-toggle.disabled .fa-spinner {
    color: #6c757d;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.dropdown-item {
    padding: 10px 15px;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #e3f2fd;
    color: #1976d2;
    transform: translateX(5px);
}

.dropdown-item.active {
    background-color: #2196f3;
    color: white;
}

/* Searchable Dropdowns */
.as-dropdown-searchable .form-control {
    border: none;
    border-bottom: 2px solid #e9ecef;
    border-radius: 0;
    font-size: 0.9rem;
}

.as-dropdown-searchable .form-control:focus {
    border-color: #0d6efd;
    box-shadow: none;
}

/* Scrollable dropdown items */
.as-dropdown-items {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6c757d #f8f9fa;
}

.as-dropdown-items::-webkit-scrollbar {
    width: 6px;
}

.as-dropdown-items::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.as-dropdown-items::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 3px;
}

.as-dropdown-items::-webkit-scrollbar-thumb:hover {
    background: #495057;
}

.as-dropdown-items {
    max-height: 300px;
    overflow-y: auto;
}

.as-dropdown-items::-webkit-scrollbar {
    width: 6px;
}

.as-dropdown-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.as-dropdown-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.as-dropdown-items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Shop Content Area */
.as-shop-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Welcome Message */
#welcomeMessage {
    background-color: #00456a !important;
    color: white;
    border-radius: 15px;
    
}

#welcomeMessage .fa-store {
    color: rgba(255, 255, 255, 0.9);
}

#welcomeMessage h2 {
    color: white;
}

#welcomeMessage .lead {
    color: rgba(255, 255, 255, 0.9);
}

/* Shop Details Content */
#shopDetailsContent {
    padding: 30px;
}

.shop-header {
    border-bottom: 2px solid #f1f3f4;
    padding-bottom: 20px;
}

.shop-header img {
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shop-description,
.shop-products,
.shop-banners {
    margin-top: 30px;
}

.shop-description .bg-light {
    background-color: #f8f9fa !important;
    border-left: 4px solid #59AC6F;
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd;
}

.product-card img {
    border-bottom: 1px solid #e9ecef;
}

.product-card .btn {
    transition: all 0.2s ease;
}

.product-card .btn:hover {
    transform: scale(1.05);
}

/* Banner Items */
.banner-item {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef !important;
}

.banner-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd !important;
}

/* Back Button */
#backToWelcome {
    transition: all 0.3s ease;
}

#backToWelcome:hover {
    transform: translateX(-5px);
}

/* Badge Styles */
.badge {
    font-size: 0.75em;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Loading States */
.spinner-border {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .as-filters-sidebar {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .filter-group {
        margin-bottom: 1rem;
    }
    
    .dropdown-toggle {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    #welcomeMessage {
        margin: 10px;
        padding: 30px 20px;
    }
    
    #welcomeMessage .fa-store {
        font-size: 2.5rem;
    }
    
    #welcomeMessage h2 {
        font-size: 1.5rem;
    }
    
    #shopDetailsContent {
        padding: 20px 15px;
    }
    
    .shop-header img {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 576px) {
    .as-filters-sidebar {
        padding: 10px;
    }
    
    .dropdown-toggle {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    .dropdown-item {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    #welcomeMessage {
        padding: 20px 15px;
    }
    
    #welcomeMessage .fa-store {
        font-size: 2rem;
    }
    
    #welcomeMessage h2 {
        font-size: 1.3rem;
    }
    
    .shop-header {
        text-align: center;
    }
    
    .shop-header .d-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .shop-header img {
        margin-bottom: 15px;
        margin-right: 0 !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .as-filters-sidebar {
        background: #2d3748;
        color: #2d3748 !important;
    }
    
    .filter-group .form-label {
        color: #e2e8f0;
    }
    
    .dropdown-menu {
        background-color: #ffffff !important;
        color: #2d3748 !important;
    }
    
    .dropdown-item {
        color: #2d3748 !important;
        border-bottom-color: #4a5568;
    }
    
    .dropdown-item:hover {
        background-color: #4a5568;
        color: #90cdf4;
    }
    
    .as-shop-content {
        background: #1a202c;
        color: #e2e8f0;
    }
    
    .shop-description .bg-light {
        background-color: #59AC6F !important;
        color: #e2e8f0;
    }
}

/* Print Styles */
@media print {
    .as-filters-sidebar,
    #backToWelcome,
    .dropdown-toggle,
    .btn {
        display: none !important;
    }
    
    .as-shop-content {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .shop-header img {
        max-width: 100px;
        max-height: 100px;
    }
}

/* Focus Indicators for Accessibility */
.dropdown-toggle:focus,
.dropdown-item:focus,
.btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .dropdown-toggle,
    .dropdown-item,
    .btn {
        border: 2px solid currentColor;
    }
    
    .dropdown-item:hover {
        background-color: currentColor;
        color: white;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Mobile Layout Enhancements */
@media (max-width: 991.98px) {
    /* Mobile Images Layout */
    .as-shop-directory .row.d-block .col-6 {
        padding: 0 8px;
    }
    
    .as-shop-directory .row.d-block img {
        border: 2px solid #f8f9fa;
        transition: transform 0.2s ease;
    }
    
    .as-shop-directory .row.d-block img:hover {
        transform: scale(1.05);
        border-color: #dee2e6;
    }
    
    /* Mobile Banner Adjustments - Keep same colors as desktop */
    .as-shop-directory #mobileBannerMessage {
        margin: 0 15px;
        /* Ensure dark background is consistent */
        background-color: #00456a !important;
        color: white !important;
    }
    
    .as-shop-directory #mobileBannerMessage h3 {
        font-size: 1.5rem;
        color: white !important;
    }
    
    .as-shop-directory #mobileBannerMessage p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        color: #f8f9fa !important;
    }
    
    /* Ensure mobile shop details replace banner properly */
    .as-shop-directory #mobileShopDetailsContent {
        margin: 0 15px;
    }
    
    /* Mobile Filters Spacing */
    .as-filters-sidebar {
        margin-bottom: 1rem;
    }
    
    .as-filters-sidebar h4 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
}

/* Desktop Layout Enhancements */
@media (min-width: 992px) {
    /* Ensure desktop shop details replace banner properly */
    .as-shop-directory #shopDetailsContent {
        /* Take the same space as the banner */
        min-height: 200px;
    }
    
    .as-shop-directory #welcomeMessage {
        /* Ensure consistent banner height */
        min-height: 200px;
    }
}

