/* ========================================
   SKELETON LOADER
   ======================================== */
.page-skeleton {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    z-index: 9999;
    padding: 1rem;
    overflow-y: auto;
    padding-bottom: 80px;
}

.skeleton-image-slider {
    height: 350px;
    background: white;
    border-radius: 10px;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.skeleton-title-meta {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.skeleton-title {
    height: 24px;
    background: #e0e0e0;
    border-radius: 4px;
    width: 80%;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

.skeleton-price {
    height: 20px;
    background: #e0e0e0;
    border-radius: 4px;
    width: 40%;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.skeleton-rating {
    height: 16px;
    background: #e0e0e0;
    border-radius: 4px;
    width: 30%;
    position: relative;
    overflow: hidden;
}

.skeleton-cart-form {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    height: 80px;
    position: relative;
    overflow: hidden;
}

.skeleton-specifications {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.skeleton-spec-line {
    height: 16px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.skeleton-related-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.skeleton-product-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    height: 200px;
    position: relative;
    overflow: hidden;
}

/* Animation Shimmer */
.skeleton-image-slider::after,
.skeleton-title-meta::after,
.skeleton-title::after,
.skeleton-price::after,
.skeleton-rating::after,
.skeleton-cart-form::after,
.skeleton-specifications::after,
.skeleton-spec-line::after,
.skeleton-product-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ========================================
   PAGE STYLES
   ======================================== */
:root {
    --deep-green: #054A29;
    --green-darker: #043920;
    --main-purple: #B491CA;
}

.single-product-slide {
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.product-main-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-main-image:hover {
    transform: scale(1.05);
    cursor: zoom-in;
}

.quantity-selector {
    height: 45px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.quantity-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--deep-green);
}

.quantity-btn:hover {
    background-color: rgba(5, 74, 41, 0.1);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 50px;
    height: 100%;
    font-size: 1rem;
    background: transparent;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart-btn {
    height: 45px;
    border-radius: 50px !important;
    padding: 0 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(5, 74, 41, 0.2);
    position: relative;
}

.add-to-cart-btn:hover {
    background-color: var(--green-darker) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(5, 74, 41, 0.3);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn.loading {
    opacity: 0.8;
    pointer-events: none;
}

.add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes cartBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.add-to-cart-btn.added {
    animation: cartBounce 0.5s;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
    animation: modalFade 0.3s;
}

@keyframes modalFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    display: block;
    margin: 60px auto;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
}

.modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 36px;
    font-weight: bold;
    padding: 16px;
    cursor: pointer;
    user-select: none;
    transition: 0.3s;
    z-index: 10001;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev {
    left: 30px;
}

.next {
    right: 30px;
}

.modal-arrow:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    .single-product-slide {
        height: 280px;
    }

    .modal-content {
        max-width: 95%;
        max-height: 70vh;
    }

    .modal-arrow {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }

    .prev {
        left: 15px;
    }

    .next {
        right: 15px;
    }

    .close-modal {
        top: 15px;
        right: 25px;
        font-size: 30px;
    }
}
