/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --success-hover: #16a34a;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition-base: all 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Top Bar */
.top-bar {
    background-color: var(--text-dark);
    color: white;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    gap: 1.5rem;
}

.contact-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-links {
    display: flex;
    gap: 1.5rem;
}

.top-links a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-links a:hover {
    color: var(--primary-color);
}

/* Header and Navigation */
header {
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-bar {
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
    display: flex;
    gap: 0.5rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-base);
}

.search-bar button:hover {
    background-color: var(--primary-hover);
}

.nav-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-action-item {
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.nav-action-item i {
    font-size: 1.25rem;
}

.nav-action-item:hover {
    color: var(--primary-color);
}

.cart {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
}

/* Category Navigation */
.category-nav {
    background-color: var(--light-bg);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.category-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    padding: 0.75rem 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-links::-webkit-scrollbar {
    display: none;
}

.category-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    padding: 0.5rem 0;
    position: relative;
}

.category-links a:hover,
.category-links a.active {
    color: var(--primary-color);
}

.category-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.page-actions {
    display: flex;
    gap: 1rem;
}

.form-select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    font-size: 0.875rem;
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Product Card */
.product-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: auto;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-image-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 aspect ratio */
    overflow: hidden;
    background-color: var(--light-bg);
}

.product-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    background-color: var(--primary-color);
    color: white;
}

.badge-discount {
    background-color: #ef4444;
    color: white;
}

.badge-best {
    background-color: #f59e0b;
    color: white;
}

.btn-wishlist {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-base);
    z-index: 1;
    box-shadow: var(--shadow-sm);
}

.btn-wishlist:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-base);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    width: 100%;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-name {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.current-price {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 700;
}

.original-price {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #f59e0b;
}

.rating span {
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.sales {
    color: var(--text-muted);
}

.product-stock {
    margin-top: 0.5rem;
}

.stock-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.stock-status.in-stock {
    color: var(--success-color);
}

.stock-status.low-stock {
    color: #f59e0b;
}

.stock-status.out-of-stock {
    color: #ef4444;
}

/* Buttons */
.btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-buy {
    grid-column: 1 / -1;
    background-color: var(--primary-color);
    color: #fff;
}

.btn-buy:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--light-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--border-color);
}

.btn-accessories {
    background-color: var(--success-color);
    color: white;
}

.btn-accessories:hover:not(:disabled) {
    background-color: var(--success-hover);
}

.btn-reviews {
    background-color: #f59e0b;
    color: white;
}

.btn-reviews:hover:not(:disabled) {
    background-color: #d97706;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
    padding: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .search-bar {
        max-width: 400px;
    }
}

@media (max-width: 992px) {
    .product-card {
        height: 260px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .nav-container {
        padding: 0.75rem 0;
    }

    .search-bar {
        display: none;
    }

    .nav-actions span {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .category-nav {
        display: none;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-actions {
        width: 100%;
    }

    .form-select {
        width: 100%;
    }

    .btn-group {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 0.625rem;
        font-size: 0.8125rem;
    }

    .product-card {
        flex-direction: column;
        height: auto;
    }

    .product-image-container {
        width: 100%;
        padding-top: 75%;
    }

    .product-info {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .accessories-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .accessory-image {
        height: 200px;
    }

    .modal-content {
        width: 98vw !important;
        max-width: 98vw !important;
        margin: 0.5rem auto !important;
        padding: 0.75rem 0.5rem !important;
        border-radius: 8px !important;
        font-size: 0.97rem !important;
    }

    .modal-content h2,
    .modal-content h3 {
        font-size: 1.1rem !important;
    }

    .specs-section {
        padding: 0.75rem !important;
    }

    .reviews-header,
    .reviews-list,
    .reviews-pagination {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .btn,
    .btn-load-more {
        font-size: 0.97rem !important;
        padding: 10px 0 !important;
        border-radius: 6px !important;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 2rem auto;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

/* Detail Header */
.detail-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.detail-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1rem;
}

.detail-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.detail-price {
    font-size: 1.5rem;
    color: #007bff;
    font-weight: bold;
}

/* Specifications Sections */
.specs-section {
    margin-bottom: 2.5rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.specs-section h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.specs-section h3 i {
    color: #007bff;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.spec-item:hover {
    transform: translateY(-2px);
}

.spec-label {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spec-label i {
    color: #007bff;
    font-size: 1rem;
}

.spec-value {
    color: #333;
    font-weight: 500;
}

/* Button Styles */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn i {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem auto;
        padding: 1.5rem;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }

    .detail-title {
        font-size: 1.5rem;
    }
}

/* Animation for spec items */
.spec-item {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessories Grid */
.accessories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
}

.accessory-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    position: relative;
}

.accessory-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.accessory-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background-color: var(--gray-100);
}

.accessory-image.loaded {
    opacity: 1;
}

.accessory-item:hover .accessory-image.loaded {
    transform: scale(1.05);
}

.accessory-caption {
    padding: 1rem;
    text-align: center;
    font-weight: 500;
    color: var(--text-dark);
    background-color: var(--light-bg);
    border-top: 1px solid var(--border-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Form Validation */
.form-control.is-invalid {
    border-color: var(--danger-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading and Error States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.image-error {
    background-color: #f8d7da;
}

/* Product Detail Styles */
.product-detail {
    padding: 2rem;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.detail-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.detail-price {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: var(--light-bg);
    border-radius: 8px;
}

.specs-section {
    background-color: var(--light-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.specs-section:last-child {
    margin-bottom: 0;
}

.specs-section h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.specs-grid {
    display: grid;
    gap: 1rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.spec-label {
    color: var(--text-dark);
    font-weight: 600;
    min-width: 180px;
}

.spec-value {
    color: var(--text-dark);
    flex: 1;
    text-align: right;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .accessories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        margin: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        box-shadow: var(--shadow-sm);
    }

    .nav-links.show {
        display: flex;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .btn-group {
        grid-template-columns: 1fr;
    }

    .product-detail {
        padding: 1rem;
    }

    .detail-meta {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .spec-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .spec-label {
        min-width: auto;
    }

    .spec-value {
        text-align: left;
    }

    .reviews-list {
        max-height: 400px;
    }

    .review-content {
        margin-left: 40px;
    }

    .review-date {
        margin-left: 40px;
    }

    .reviews-sort {
        width: 100%;
        margin-top: 10px;
    }

    .reviews-filter {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .accessories-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .accessory-image {
        height: 200px;
    }
}

/* Print Styles */
@media print {

    .btn-group,
    .mobile-menu-btn,
    .modal {
        display: none !important;
    }
}

/* Loading States */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid var(--white);
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-loading-spinner 0.75s linear infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Modal Accessibility */
.modal[aria-hidden="true"] {
    display: none;
}

.modal[aria-hidden="false"] {
    display: block;
}

/* Mobile Menu Accessibility */
.mobile-menu-btn[aria-expanded="true"] .menu-icon {
    transform: rotate(45deg);
}

.mobile-menu-btn[aria-expanded="true"] .menu-icon::before {
    transform: rotate(90deg);
    top: 0;
}

.mobile-menu-btn[aria-expanded="true"] .menu-icon::after {
    transform: rotate(90deg);
    bottom: 0;
}

/* Image Error States */
.image-error {
    position: relative;
}

.image-error::before {
    content: '⚠️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 1;
    pointer-events: none;
}

.image-error .accessory-image {
    opacity: 0.5;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    margin: 20px auto;
    text-align: center;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Image Loading States */
.accessory-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.accessory-image.loaded {
    opacity: 1;
}

.image-error {
    position: relative;
}

.image-error::before {
    content: '⚠️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 1;
}

.image-error img {
    opacity: 0.5;
}

/* Reviews Styles */
.reviews-header {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.reviews-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.rating-large {
    font-size: 2.5em;
    color: #f8c51d;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rating-large::after {
    content: '/ 5';
    font-size: 0.4em;
    color: #666;
    margin-left: 5px;
}

.reviews-count {
    color: #666;
    font-size: 1.1em;
    margin-top: 5px;
}

.reviews-list {
    max-height: 600px;
    overflow-y: auto;
    padding: 0 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
}

.review-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    position: relative;
    transition: background-color 0.2s;
}

.review-item:hover {
    background-color: #f9f9f9;
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reviewer-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #4CAF50;
}

.reviewer-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

.review-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.2em;
}

.review-rating .star-filled {
    color: #f8c51d;
    text-shadow: 0 0 2px rgba(248, 197, 29, 0.3);
}

.review-rating .star-empty {
    color: #ddd;
}

.review-rating:hover .star-filled {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.review-content {
    color: #555;
    line-height: 1.5;
    margin-left: 50px;
    margin-bottom: 5px;
}

.review-date {
    color: #888;
    font-size: 0.9em;
    margin-left: 50px;
}

/* Loading state for reviewer photos */
.reviewer-photo.loading {
    background-color: #f0f0f0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Scrollbar styling for reviews list */
.reviews-list::-webkit-scrollbar {
    width: 8px;
}

.reviews-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.reviews-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
    border: 2px solid #f1f1f1;
}

.reviews-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.reviews-filter {
    margin-top: 15px;
    text-align: right;
}

.reviews-sort {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.reviews-sort:hover {
    border-color: #4CAF50;
}

.reviews-sort:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.reviews-pagination {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #eee;
}

.btn-load-more {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 150px;
}

.btn-load-more:hover {
    background-color: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-load-more:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-load-more:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Rating animation */
@keyframes starPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.review-rating:hover .star-filled {
    animation: starPulse 0.5s ease;
}

/* Rating tooltip */
.review-rating {
    position: relative;
}

.review-rating::after {
    content: attr(data-rating);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.review-rating:hover::after {
    opacity: 1;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
    background-color: #25D366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background-color: #20BA5A;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float:active {
    transform: scale(0.95);
}

.whatsapp-float i {
    margin-top: 0;
    font-size: 32px;
}

.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #333;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
}

/* Pulse animation untuk WhatsApp button */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }

    100% {
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    }
}

/* Responsive untuk mobile */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
        font-size: 28px;
    }

    .whatsapp-float i {
        font-size: 28px;
    }

    .whatsapp-tooltip {
        right: 65px;
        font-size: 13px;
        padding: 6px 10px;
    }

    /* Hide tooltip di mobile jika terlalu kecil */
    @media (max-width: 480px) {
        .whatsapp-tooltip {
            display: none;
        }
    }
}

/* Pastikan tidak overlap dengan notifikasi */
@media (max-width: 576px) {
    .whatsapp-float {
        bottom: 80px;
    }
}