/* ============================================
   PC GILMORE - Products Page Styles
   ============================================ */


/* Page Header */

.page-header {
    background-color: var(--primary-color);
    padding: 150px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/image/background_1.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.2;
}

.page-header-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(26, 26, 46, 0.98) 100%);
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    color: var(--secondary-color);
    font-size: 3rem;
    margin-bottom: 15px;
}

.page-header p {
    color: rgba(245, 240, 232, 0.9);
    font-size: 1.2rem;
}


/* Category Filter */

.category-filter {
    background-color: white;
    padding: 30px 0;
    position: sticky;
    top: 75px;
    z-index: 100;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.filter-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--secondary-dark);
    background-color: var(--secondary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-speed);
    flex-shrink: 0;
    color: var(--text-dark);
}

.filter-nav:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.filter-nav svg {
    display: block;
}

.filter-wrapper {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 5px 0;
    scroll-behavior: smooth;
    flex: 1;
}

.filter-wrapper::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid var(--secondary-dark);
    background-color: transparent;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition-speed);
    flex-shrink: 0;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: rgba(235, 11, 11, 0.747);
    border-color: rgba(235, 11, 11, 0.747);
    color: var(--text-light);
}


/* Products Section */

.products-section {
    background-color: var(--secondary-color);
    padding: 60px 0 100px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-speed);
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.product-card.hidden {
    display: none;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 102, 255, 0.15);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--accent-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.product-image {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary-color) 100%);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 220px;
    transition: all var(--transition-speed);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-info .product-category {
    display: inline-block;
    background-color: rgba(0, 102, 255, 0.1);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-info h4 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--text-dark);
    line-height: 1.4;
}

.product-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
    flex: 1;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    margin-top: auto;
}

.product-info .btn {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
}


/* Custom Build CTA */

.custom-build-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 80px 0;
}

.cta-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 60px;
    align-items: center;
}

.cta-content h2 {
    color: var(--secondary-color);
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.cta-content p {
    color: rgba(245, 240, 232, 0.9);
    font-size: 1.1rem;
    margin-bottom: 25px;
    max-width: 500px;
}

.cta-icon {
    background-color: rgba(245, 240, 232, 0.1);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-icon svg {
    width: 100px;
    height: 100px;
    color: var(--secondary-color);
}


/* No Products Message */

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-products svg {
    width: 80px;
    height: 80px;
    color: var(--primary-color);
    opacity: 0.3;
    margin-bottom: 20px;
}

.no-products h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}


/* Product Card Clickable */

.product-card {
    cursor: pointer;
}

.product-card .btn {
    position: relative;
    z-index: 5;
}


/* Product Preview Modal */

.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-modal.show {
    display: flex;
    opacity: 1;
}

.product-modal-content {
    background-color: white;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: var(--secondary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--transition-speed);
}

.modal-close:hover {
    background-color: var(--primary-color);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: var(--text-dark);
    transition: color var(--transition-speed);
}

.modal-close:hover svg {
    color: white;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}


/* Modal Image Gallery */

.modal-image-gallery {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary-color) 100%);
}

.modal-main-image {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 350px;
}

.modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 400px;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.modal-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--accent-color);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    display: none;
    z-index: 5;
}

.modal-badge.show {
    display: block;
}


/* Gallery Navigation Arrows */

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--transition-speed);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.gallery-nav:hover {
    background-color: var(--primary-color);
}

.gallery-nav svg {
    color: var(--text-dark);
    transition: color var(--transition-speed);
}

.gallery-nav:hover svg {
    color: white;
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}


/* Thumbnails */

.modal-thumbnails {
    display: flex;
    gap: 8px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.95);
    overflow-x: auto;
    scrollbar-width: none;
}

.modal-thumbnails::-webkit-scrollbar {
    display: none;
}

.modal-thumbnail {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-speed);
    opacity: 0.6;
}

.modal-thumbnail:hover {
    opacity: 0.9;
    border-color: var(--primary-light);
}

.modal-thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
}

.modal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.modal-info-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 40px 40px 20px 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(0, 0, 0, 0.1);
}

.modal-info-scrollable::-webkit-scrollbar {
    width: 6px;
}

.modal-info-scrollable::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.modal-info-scrollable::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 3px;
}

.modal-info-fixed {
    padding: 20px 40px 30px 40px;
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.modal-category {
    display: inline-block;
    background-color: rgba(0, 102, 255, 0.1);
    color: var(--accent-color);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.modal-info h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.3;
}

.modal-description {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 25px;
}

.modal-specs {
    background-color: var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.modal-specs h4 {
    font-size: 1rem;
    color: var(--accent-color);
    margin-bottom: 12px;
}

.modal-specs ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-specs li {
    padding: 8px 0;
    color: #555;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-specs li:last-child {
    border-bottom: none;
}

.modal-specs li::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    flex-shrink: 0;
}

.modal-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-actions .btn {
    width: 100%;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    font-size: 1.05rem;
}

.btn-shopee {
    background-color: #EE4D2D;
    color: white;
    border: none;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

.btn-shopee .btn-shopee-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 8px;
    /* ensure visibility on orange background if logo is dark */
    filter: brightness(0) invert(1);
}

.btn-shopee:hover {
    background-color: #D73211;
    color: white;
    transform: translateY(-2px);
}


/* Responsive Styles */


/* Tablet Landscape */

@media (max-width: 992px) {
    .page-header h1 {
        font-size: 2.5rem;
    }
    .page-header p {
        font-size: 1.1rem;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cta-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .cta-content p {
        max-width: none;
    }
    .cta-icon {
        display: none;
    }
    .product-modal {
        padding: 15px;
        align-items: flex-start;
    }
    .product-modal-content {
        max-height: 96vh;
        margin-top: 10px;
    }
    .modal-body {
        grid-template-columns: 1fr;
        max-height: calc(96vh - 20px);
        overflow-y: auto;
    }
    .modal-main-image {
        min-height: 200px;
    }
    .modal-main-image img {
        max-height: 220px;
    }
    .modal-thumbnail {
        width: 60px;
        height: 60px;
    }
    .modal-info {
        max-height: none;
    }
    .modal-info-scrollable {
        padding: 25px 25px 15px 25px;
        max-height: 40vh;
        overflow-y: auto;
    }
    .modal-info-fixed {
        padding: 15px 25px 20px 25px;
    }
    .modal-info h2 {
        font-size: 1.5rem;
    }
    .modal-price {
        font-size: 1.6rem;
    }
    .modal-specs {
        padding: 15px;
        margin-bottom: 20px;
    }
    .modal-actions .btn {
        width: 100%;
        padding: 14px 25px;
    }
}


/* Tablet Portrait */

@media (max-width: 768px) {
    .page-header {
        padding: 110px 0 50px;
    }
    .page-header h1 {
        font-size: 1.9rem;
    }
    .page-header p {
        font-size: 1rem;
    }
    .category-filter {
        padding: 15px 0;
        position: static;
    }
    .filter-container {
        gap: 8px;
    }
    .filter-nav {
        width: 36px;
        height: 36px;
    }
    .filter-nav svg {
        width: 18px;
        height: 18px;
    }
    .filter-wrapper {
        gap: 8px;
        padding: 5px 0;
    }
    .filter-btn {
        padding: 8px 18px;
        font-size: 0.85rem;
        border-radius: 25px;
    }
    .products-section {
        padding: 35px 0 60px;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .product-card {
        border-radius: 12px;
    }
    .product-badge {
        top: 10px;
        left: 10px;
        padding: 4px 12px;
        font-size: 0.75rem;
    }
    .product-image {
        height: 180px;
    }
    .product-info {
        padding: 18px;
    }
    .product-info .product-category {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
    .product-info h4 {
        font-size: 1rem;
    }
    .product-info p {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    .product-price {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    .product-info .btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    .custom-build-cta {
        padding: 60px 0;
    }
    .cta-content h2 {
        font-size: 1.7rem;
    }
    .cta-content p {
        font-size: 1rem;
    }
    .product-modal {
        padding: 10px;
        align-items: flex-start;
    }
    .product-modal-content {
        max-height: 97vh;
        margin-top: 8px;
    }
    .modal-body {
        max-height: calc(97vh - 16px);
        overflow-y: auto;
    }
    .modal-close {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
    .modal-main-image {
        min-height: 180px;
    }
    .modal-main-image img {
        max-height: 200px;
        padding: 15px;
    }
    .gallery-nav {
        width: 35px;
        height: 35px;
    }
    .modal-thumbnails {
        padding: 10px;
        gap: 6px;
    }
    .modal-thumbnail {
        width: 50px;
        height: 50px;
    }
    .modal-info {
        max-height: none;
    }
    .modal-info-scrollable {
        padding: 22px 22px 12px 22px;
        max-height: 35vh;
        overflow-y: auto;
    }
    .modal-info-fixed {
        padding: 12px 22px 18px 22px;
    }
    .modal-info h2 {
        font-size: 1.35rem;
    }
    .modal-description {
        font-size: 0.9rem;
        margin-bottom: 18px;
    }
    .modal-price {
        font-size: 1.4rem;
        margin-bottom: 18px;
    }
    .modal-specs {
        padding: 15px;
        margin-bottom: 18px;
    }
    .modal-specs li {
        font-size: 0.88rem;
    }
    .modal-actions .btn {
        width: 100%;
        padding: 13px 22px;
        font-size: 0.95rem;
    }
}


/* Mobile */

@media (max-width: 480px) {
    .page-header {
        padding: 100px 0 40px;
    }
    .page-header h1 {
        font-size: 1.6rem;
    }
    .page-header p {
        font-size: 0.9rem;
    }
    .category-filter {
        padding: 12px 0;
    }
    .filter-btn {
        padding: 7px 14px;
        font-size: 0.8rem;
    }
    .products-section {
        padding: 30px 0 50px;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-image {
        height: 120px;
    }
    .product-info {
        padding: 12px 10px;
    }
    .product-info .product-category {
        font-size: 0.6rem;
        padding: 3px 8px;
        margin-bottom: 8px;
    }
    .product-info h4 {
        font-size: 0.85rem;
        margin-bottom: 5px;
        line-height: 1.3;
    }
    .product-info p {
        font-size: 0.75rem;
        margin-bottom: 8px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .product-price {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    .product-info .btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    .product-badge {
        top: 8px;
        left: 8px;
        padding: 3px 8px;
        font-size: 0.65rem;
    }
    .custom-build-cta {
        padding: 50px 0;
    }
    .cta-content h2 {
        font-size: 1.4rem;
    }
    .cta-content p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    .product-modal {
        padding: 5px;
        align-items: flex-start;
    }
    .product-modal-content {
        border-radius: 15px;
        max-height: 98vh;
        margin-top: 5px;
    }
    .modal-body {
        max-height: calc(98vh - 15px);
        overflow-y: auto;
    }
    .modal-close {
        width: 32px;
        height: 32px;
        top: 8px;
        right: 8px;
    }
    .modal-close svg {
        width: 16px;
        height: 16px;
    }
    .modal-main-image {
        min-height: 140px;
    }
    .modal-main-image img {
        max-height: 160px;
        padding: 10px;
    }
    .gallery-nav {
        width: 30px;
        height: 30px;
    }
    .gallery-nav svg {
        width: 16px;
        height: 16px;
    }
    .gallery-prev {
        left: 5px;
    }
    .gallery-next {
        right: 5px;
    }
    .modal-thumbnails {
        padding: 8px;
        gap: 5px;
    }
    .modal-thumbnail {
        width: 45px;
        height: 45px;
        border-radius: 6px;
    }
    .modal-badge {
        padding: 6px 15px;
        font-size: 0.75rem;
        top: 10px;
        left: 10px;
    }
    .modal-info {
        max-height: none;
    }
    .modal-info-scrollable {
        padding: 18px 15px 10px 15px;
        max-height: 30vh;
        overflow-y: auto;
    }
    .modal-info-fixed {
        padding: 10px 15px 15px 15px;
    }
    .modal-category {
        font-size: 0.7rem;
        padding: 4px 10px;
        margin-bottom: 10px;
    }
    .modal-info h2 {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }
    .modal-description {
        font-size: 0.85rem;
        margin-bottom: 15px;
        line-height: 1.5;
    }
    .modal-price {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }
    .modal-specs {
        padding: 12px;
        margin-bottom: 15px;
    }
    .modal-specs h4 {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    .modal-specs li {
        font-size: 0.8rem;
        padding: 5px 0;
    }
    .modal-actions {
        padding-top: 5px;
        padding-bottom: 10px;
    }
    .modal-actions .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
    }
}


/* ============================================
   Loading State
   ============================================ */

.loading-products {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 102, 255, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-products p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}