/* Core Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensures navbar stays on top of other content */
}

/* Store Header */
.store-header {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 80px 0 40px;
    position: relative;
}

/* Store Logo and Info */
.store-logo {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    border: 4px solid white;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: white;
}

.store-info {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.store-stats {
    background-color: #f1f8ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
    padding: 15px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #0d6efd;
}

/* Testimonials and Reviews */
.testimonial {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.testimonial-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* Product Card and Styling */
.product-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    transition: transform 0.3s;
    height: 100%;
}

    .product-card:hover {
        transform: translateY(-5px);
    }

.product-img {
    height: 200px;
    object-fit: cover;
}

.product-body {
    padding: 20px;
    background-color: white;
    display: flex;
    flex-direction: column;
    height: calc(100% - 200px);
}

.price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #0d6efd;
}

.old-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.9rem;
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #dc3545;
    color: white;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 30px;
    font-size: 0.85rem;
}

.category-badge {
    background-color: #e7f1ff;
    color: #0d6efd;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 5px;
    margin-bottom: 5px;
    display: inline-block;
}

    .category-badge.active {
        background-color: #0d6efd;
        color: white;
    }

/* Social Media and Icons */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #f8f9fa;
    color: #0d6efd;
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.3s;
}

    .social-icon:hover {
        background-color: #0d6efd;
        color: white;
    }

/* Navigation Tabs */
.nav-tabs .nav-link {
    border: none;
    color: #495057;
    font-weight: 500;
    padding: 15px 20px;
}

    .nav-tabs .nav-link.active {
        color: #0d6efd;
        background-color: transparent;
        border-bottom: 3px solid #0d6efd;
    }

/* Store Features */
.store-features {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.feature-icon {
    width: 50px;
    height: 50px;
    background-color: #e7f1ff;
    color: #0d6efd;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
}

/* Buttons and Interactive Elements */
.cart-btn {
    width: 100%;
    border-radius: 30px;
    font-weight: 500;
    margin-top: auto;
}

.wishlist-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    color: #dc3545;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.3s;
}

    .wishlist-btn:hover {
        background-color: #dc3545;
        color: white;
    }

.review-stars {
    color: #ffc107;
}

/* Filter and Sort Section */
.filter-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.sort-select {
    border-radius: 30px;
    padding: 8px 15px;
}

/* Contact Information */
.contact-info {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.contact-item {
    margin-bottom: 15px;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background-color: #e7f1ff;
    color: #0d6efd;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

/* Business Hours Dropdown Styling */
.business-hours-container {
    flex: 1;
    position: relative;
}

#todayBusinessHours .btn-link {
    text-decoration: none;
    color: inherit;
    padding: 0;
    text-align: left;
    width: 100%;
}

#todayBusinessHours .btn-link:hover,
#todayBusinessHours .btn-link:focus {
    text-decoration: none;
    color: #0d6efd;
}

.dropdown-menu {
    position: absolute !important;
    z-index: 2147483647 !important;
}

#businessHoursList {
    display: none;
    position: fixed;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 2147483647;
    min-width: 200px;
}

#businessHoursList.show {
    display: block;
}

#businessHoursList .dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
}

#businessHoursList .dropdown-item.current-day .day-name {
    font-weight: bold;
    color: #0d6efd;
}

#businessHoursList .dropdown-item:hover {
    background-color: #f8f9fa;
}

.business-hours {
    font-weight: normal;
}

.business-status-open {
    font-weight: bold;
    color: #28a745;
}

.business-status-closed {
    font-weight: bold;
    color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .store-header {
        padding: 60px 0 30px;
    }

    .store-logo {
        width: 100px;
        height: 100px;
    }

    .store-info {
        margin-top: -30px;
        padding: 20px;
    }

    .product-img {
        height: 180px;
    }

    .nav-tabs .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .store-header {
        padding: 40px 0 20px;
    }

    .social-icon {
        width: 35px;
        height: 35px;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
    }

    .contact-icon {
        width: 35px;
        height: 35px;
    }
}

/* Stories Styling */
.stories-container {
    display: flex;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
    scrollbar-width: none; /* Firefox */
}

    .stories-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }

.story-item {
    position: relative;
    min-width: 100px;
    width: 100px;
    height: 160px;
    margin-right: 10px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
}

    .story-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.story-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.5));
}

.story-profile {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #0d6efd;
    object-fit: cover;
}

.story-text {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    color: white;
    font-size: 12px;
    padding: 0 5px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.create-story {
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.create-story-icon {
    width: 40px;
    height: 40px;
    background-color: #0d6efd;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.story-modal .modal-content {
    background-color: #000;
    color: white;
}

.story-modal .story-view {
    height: 70vh;
    position: relative;
}

    .story-modal .story-view img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.story-progress {
    display: flex;
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
}

.story-progress-bar {
    height: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 2px;
    flex: 1;
}

    .story-progress-bar.active {
        background-color: white;
    }

.story-controls {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
}

.story-prev, .story-next {
    flex: 1;
}

/* Editing Styling */
.admin-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
    color: white;
    text-align: center;
    pointer-events: none;
}

/* Only show admin controls for users with edit rights */
.admin-edit-container:hover .admin-edit-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Position relative to make overlays work */
.admin-edit-container {
    position: relative;
}

/* Style for edit buttons */
.edit-btn {
    background-color: #0d6efd;
    color: white;
    border: none;
    padding: 8px 16px;
    margin: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .edit-btn:hover {
        background-color: #0b5ed7;
    }

/* Profile image container */
.profile-image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 100%;
}

/* Styles for placeholder loading animations */
.placeholder-pulse {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: placeholder-pulse 1.5s infinite;
}

@keyframes placeholder-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Notification toast styling */
.toast-container {
    z-index: 1080;
}

/* Add this to your store.css file */

/* Story Viewer Styles */
.story-modal .modal-content {
    background-color: #000;
    height: 100%;
}

.story-view {
    position: relative;
    height: 100vh;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    padding: 12px;
    gap: 4px;
    z-index: 2;
}

.story-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    flex: 1;
    border-radius: 3px;
    overflow: hidden;
}

.story-progress-bar:before {
    content: '';
    height: 100%;
    width: 0;
    background: white;
    display: block;
    border-radius: 3px;
}

.story-progress-bar.active:before {
    animation: progress 5s linear forwards;
}

@keyframes progress {
    0% { width: 0; }
    100% { width: 100%; }
}

.story-content-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-content-container img,
.story-content-container video {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.story-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.story-prev, .story-next {
    flex: 1;
    z-index: 1;
    cursor: pointer;
}

.story-caption-container {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding-top: 20px;
}

/* Comment Styles */
.comment-bubble {
    background-color: #f5f5f5;
    border-radius: 18px;
    padding: 8px 12px;
    max-width: 90%;
}

.comments-section {
    max-height: 300px;
    overflow-y: auto;
}

.z-2 {
    z-index: 2;
}

.z-3 {
    z-index: 3;
}

/* Post styles */
.post-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.post-action-btn {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-action-btn:hover {
    background-color: #f1f1f1;
}

.post-action-btn.active {
    color: #007bff;
}

.post-action-btn.active i {
    color: #007bff;
}

/* Media gallery styles */
.media-gallery {
    display: grid;
    grid-gap: 4px;
    margin-bottom: 12px;
}

.media-gallery.media-count-1 {
    grid-template-columns: 1fr;
}

.media-gallery.media-count-2 {
    grid-template-columns: 1fr 1fr;
}

.media-gallery.media-count-3 {
    grid-template-columns: 1fr 1fr;
}

.media-gallery.media-count-3 .media-item:first-child {
    grid-column: span 2;
}

.media-gallery.media-count-4 {
    grid-template-columns: 1fr 1fr;
}

.media-item {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: 4px;
}

.media-item img, 
.media-item video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Star Rating Styles */
.star-rating {
    font-size: 1.5rem;
    display: inline-flex;
    cursor: pointer;
}

.star-rating i {
    margin-right: 5px;
    transition: all 0.2s ease;
}

.star-rating i:hover {
    transform: scale(1.1);
}

.star-rating i.fas {
    color: #ffc107; /* Yellow color for selected stars */
}

.star-rating i.far {
    color: #6c757d; /* Gray color for unselected stars */
}

.star-rating.is-invalid i {
    color: #dc3545; /* Red color for error state */
}

/* Review Statistics */
.rating-breakdown .progress {
    height: 10px;
    border-radius: 5px;
    min-width: 150px;
}

.rating-breakdown .progress-bar {
    background-color: #ffc107;
}

.rating-breakdown .d-flex {
    margin-bottom: 8px;
    align-items: center;
}

/* Review item styles */
.testimonial {
    position: relative;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.testimonial:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.testimonial-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f8f9fa;
}

.testimonial .review-stars {
    margin-bottom: 5px;
    color: #ffc107; /* Yellow color for stars */
}

.testimonial .helpful-button.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Animation for new reviews */
@keyframes highlight-review {
    0% { background-color: rgba(13, 110, 253, 0.1); }
    100% { background-color: transparent; }
}

.testimonial.new-review {
    animation: highlight-review 2s ease-out;
}

/* Facebook-style post input styling */
.post-input-field {
    cursor: pointer;
}

.post-placeholder {
    color: #65676B;
    background-color: #F0F2F5;
    border-radius: 20px;
    padding: 8px 12px;
    cursor: pointer;
}

.post-placeholder:hover {
    background-color: #E4E6E9;
}

/* Post modal styling */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    border: none;
    background: none;
}

.btn-icon:hover {
    background-color: #F0F2F5;
}

.btn-icon i {
    font-size: 18px;
}

/* Media preview area */
#mediaPreviewArea {
    background-color: #F0F2F5;
    border-radius: 8px;
}

.post-image-container {
    width: 100%; /* Container mengambil lebar penuh dari parent */
    position: relative;
    overflow: hidden; /* Mencegah content keluar dari container */
  }
  
  .post-image-container img {
    width: 100%;
    height: auto;
    object-fit: contain; /* Ini membuat gambar fit sepenuhnya tanpa terpotong */
    max-height: 500px; /* Sesuaikan dengan kebutuhan maksimal tinggi */
    display: block; /* Menghilangkan gap di bawah gambar */
  }

  /* Override untuk gambar post */
.media-gallery.media-count-1 .media-item {
    padding-bottom: 0 !important; /* Hilangkan padding yang memaksa rasio 1:1 */
    height: auto;
}

.media-gallery.media-count-1 .media-item img {
    position: static !important; /* Reset position absolute */
    height: auto !important; /* Biarkan tinggi mengikuti rasio asli */
    max-height: 600px; /* Tetapkan tinggi maksimal */
    width: 100%;
    object-fit: contain !important; /* Tampilkan gambar utuh */
}

/* Solusi untuk aspect ratio mirip Facebook/Instagram */
.media-gallery.media-count-1 {
    max-width: 500px; /* Batasi lebar maksimal container */
    margin: 0 auto 15px; /* Tengahkan dan beri margin bawah */
}

.media-gallery.media-count-1 .media-item {
    padding-bottom: 0; /* Hilangkan padding yang memaksa rasio */
    height: auto;
    overflow: hidden;
    border-radius: 8px; /* Beri rounded corner ala sosmed */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Shadow subtle ala Facebook */
}

.media-gallery.media-count-1 .media-item img {
    position: static !important;
    width: 100%;
    height: auto !important;
    max-height: 500px; /* Batasi tinggi maksimal */
    object-fit: contain !important;
}

.modal.show .modal-dialog {
    transform: none;
    top: 10%;
    margin: 0 auto;
}

.modal-backdrop {
    z-index: 1040;
  }
  .modal.story-modal {
    z-index: 1050;
  }
  .modal.story-modal .modal-dialog {
    z-index: 1060;
  }

  /* Add this to your CSS */
.modal-dialog {
    z-index: 1056 !important; /* Higher than highest backdrop z-index */
    position: relative;
  }
  
  .modal.show {
    z-index: 1055 !important; /* Higher than backdrop */
  }
  
  .modal-backdrop {
    z-index: 1040 !important; /* Keep backdrop behind */
  }