.product-page {
    padding: 20px 0;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

.main-image-container {
    height: 450px;
    border-radius: 15px;
    overflow: hidden;
    background-color: transparent;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.image-zoom-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

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


.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-fullscreen-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-image-container:hover .gallery-nav,
.main-image-container:hover .gallery-fullscreen-btn {
    opacity: 1;
}

.gallery-nav.prev-btn {
    left: 15px;
}

.gallery-nav.next-btn {
    right: 15px;
}

.gallery-nav:focus {
    outline: none; 
    opacity: 1;
}


.gallery-nav.hidden {
    display: none;
}

.thumbnails-container {
    width: 100%;
    padding: 5px 0;
}

.thumbnails-slider {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.thumbnail {
    min-width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
}

.thumbnail.active {
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.thumbnail:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

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

.product-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.product-title {
    font-size: 1.8rem;
    color: var(--dark-color);
}

.product-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.product-description {
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 5px;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-section {
    background-color: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--box-shadow);
}

.form-section-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    color: var(--dark-color);
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group {
    margin-bottom: 0.3rem;
    position: relative;
    width: 100%;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.1);
}

.form-label {
    color: #444;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 1rem;
}
.form-label-icon {
    color: #444;
    font-size: 1.1em;
    margin-left: 4px;
    vertical-align: middle;
}

.delivery-options {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    justify-content: flex-start;
}

.delivery-option {
    flex: 0 0 auto;
    width: auto;
    min-width: 140px;
    max-width: 180px;
    display: inline-block;
}

.delivery-option input {
    display: none;
}

.delivery-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    height: 100%;
}

.delivery-option input:checked + .delivery-option-content {
    border-color: var(--primary-color);
    background-color: rgba(74, 107, 255, 0.05);
}

.delivery-option i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.quantity-btn:hover {
    background-color: var(--primary-dark);
}

.quantity-input {
    width: 70px;
    text-align: center;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    pointer-events: none;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    order: 1;
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shine 3s infinite;
}

.submit-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 15px rgba(74, 107, 255, 0.3);
}

.submit-btn:active {
    transform: translateY(1px) scale(0.98);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 107, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 107, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 107, 255, 0);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    20% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
    }

    .main-image-container {
        height: auto; /* Let the image determine the height */
        max-height: 70vh; /* Prevent image from being excessively tall */
    }

    .product-title,
    .product-price {
        font-size: 1.5rem;
    }

    .long-description-section {
        margin-top: 20px;
    }

    .long-description-content img {
        max-width: 100%;
        height: auto;
        display: block; /* Ensures the image is treated as a block-level element */
        margin: 10px 0; /* Adds some vertical spacing */
    }
}

.order-summary {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--box-shadow);
    order: 2;
}

.summary-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: var(--dark-color);
}

.summary-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
}

.summary-item.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-weight: bold;
    font-size: 1.1rem;
}

.error-message {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
    text-align: right;
    display: block;
}

.form-input.error, .form-select.error {
    border-color: #dc3545 !important;
}

@media (max-width: 992px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
    
    .main-image-container {
        height: 400px;
    }
}

@media (max-width: 576px) {
    .main-image-container {
        height: 300px;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
    
    .delivery-options {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px;
    }
    
    .delivery-option {
        min-width: 110px;
        max-width: 130px;
    }
    .delivery-option-content {
        font-size: 0.93rem;
        padding: 10px 4px;
    }
    .delivery-option-content i {
        font-size: 1.1rem;
    }
    .form-section {
        padding: 20px;
    }
}

.messages-container {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    border-right: 4px solid transparent;
}

.alert-danger {
    background-color: #fff3f3;
    color: #e74c3c;
    border-color: #e74c3c;
}

.alert-success {
    background-color: #f0fff4;
    color: #2ecc71;
    border-color: #2ecc71;
}

.alert-warning {
    background-color: #fffbf0;
    color: #f39c12;
    border-color: #f39c12;
}

.alert-info {
    background-color: #f0f9ff;
    color: #3498db;
    border-color: #3498db;
}

.sticky-order-button {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.sticky-order-button.show {
    opacity: 1;
    pointer-events: auto;
}

.sticky-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.sticky-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.sticky-btn i {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .sticky-order-button {
        padding: 12px;
    }
    
    .sticky-btn {
        padding: 12px 15px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .sticky-order-button {
        padding: 10px;
    }
    
    .sticky-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

.long-description-section {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: var(--dark-color);
}

.long-description-content {
    color: var(--text-color);
    line-height: 1.8;
}

.long-description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

.long-description-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.long-description-content table th,
.long-description-content table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: right;
}

.long-description-content table th {
    background-color: #f5f5f5;
}

.long-description-content ul,
.long-description-content ol {
    padding-right: 20px;
    margin: 15px 0;
}

.long-description-content h1,
.long-description-content h2,
.long-description-content h3,
.long-description-content h4 {
    margin: 20px 0 10px;
    color: var(--dark-color);
}

@media (max-width: 768px) {
    .long-description-section {
        margin-top: 20px;
        padding: 15px;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
}


.image-dots-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
}

.image-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 1200px;
    height: 90%;
}

#lightbox-image {
    max-width: 90%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
}

@keyframes zoom {
    from {transform:scale(0.4)}
    to {transform:scale(1)}
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    background-color: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 1010;
}

.lightbox-close:hover {
    background-color: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.lightbox-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 1005;
}

.lightbox-nav.prev-btn {
    left: 20px;
}

.lightbox-nav.next-btn {
    right: 20px;
}

.lightbox-nav:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-thumbnails {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    overflow-x: auto;
    white-space: nowrap;
    display: none;
}

.lightbox-thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.lightbox-thumbnail.active {
    border-color: white;
    opacity: 1;
}

.lightbox-thumbnail:hover {
    opacity: 1;
    transform: translateY(-3px);
}

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

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

.lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 50px;
}

@media only screen and (max-width: 700px){
    .lightbox-content {
        width: 95%;
        max-width: 95%;
    }
    .lightbox-close {
        font-size: 30px;
        top: 10px;
        right: 20px;
    }
}

@media (max-width: 767px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 80%;
    }

    .lightbox-nav {
        display: none;
    }

    .lightbox-thumbnails {
        bottom: 5px;
        padding: 5px;
    }

    .lightbox-thumbnail {
        width: 40px;
        height: 40px;
        margin: 0 3px;
    }
}

.product-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
