/* Gallery Page Specific Styles */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--terracotta), var(--deep-emerald));
    color: var(--white);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="30" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="50" r="2.5" fill="rgba(255,255,255,0.1)"/><circle cx="30" cy="70" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="70" cy="80" r="1.8" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    animation: dotFloat 25s ease-in-out infinite;
}

@keyframes dotFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(180deg);
    }
}

.page-title {
    font-size: 3.2rem;
    margin-bottom: 1rem;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Gallery Collection */
.gallery-collection {
    padding: 4rem 0;
    background-color: var(--warm-ivory);
}

.gallery-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    background-color: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-hover);
}

.gallery-item:nth-child(even) {
    direction: rtl;
}

.gallery-item:nth-child(even) .gallery-content {
    direction: ltr;
}

.gallery-image {
    position: relative;
    overflow: hidden;
    min-height: 400px;
    background: linear-gradient(135deg, var(--ash-grey), var(--warm-ivory));
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 0;
    loading: lazy;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

.gallery-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gallery-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--charcoal);
    font-family: 'Crimson Text', serif;
    line-height: 1.3;
}

.gallery-description {
    color: var(--warm-brown);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
}

.gallery-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--warm-brown);
}

.gallery-size,
.gallery-material {
    font-weight: 500;
}

.gallery-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stars {
    color: var(--gold-ochre);
    font-size: 1.1rem;
}

.rating-score {
    font-weight: 600;
    color: var(--charcoal);
    font-size: 1.1rem;
}

.rating-count {
    color: var(--warm-brown);
    font-size: 0.9rem;
}

.gallery-price {
    font-size: 2rem;
    font-weight: 600;
    color: var(--terracotta);
    margin-bottom: 2rem;
    font-family: 'Crimson Text', serif;
}

.want-to-buy-btn {
    align-self: flex-start;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.want-to-buy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.want-to-buy-btn:hover::before {
    left: 100%;
}

.want-to-buy-btn:hover {
    background-color: var(--deep-emerald);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 90, 74, 0.3);
}

/* Customer Reviews */
.customer-reviews {
    padding: 4rem 0;
    background-color: var(--white);
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.review-card {
    background-color: var(--warm-ivory);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--terracotta);
}

.review-card:hover {
    transform: translateY(-3px);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reviewer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--muted-coral), var(--gold-ochre));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
}

.reviewer-details h4 {
    color: var(--charcoal);
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.reviewer-details p {
    color: var(--warm-brown);
    font-size: 0.9rem;
    margin: 0;
}

.review-rating .stars {
    font-size: 1rem;
}

.review-text {
    color: var(--warm-brown);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-style: italic;
}

.review-product {
    font-size: 0.8rem;
    color: var(--terracotta);
    font-weight: 500;
}

/* Purchase Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    color: var(--warm-brown);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--terracotta);
}

.modal-content h2 {
    color: var(--charcoal);
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.purchase-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--charcoal);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid var(--ash-grey);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--terracotta);
    box-shadow: 0 0 0 3px rgba(198, 93, 74, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.cancel-btn {
    background-color: var(--ash-grey);
    color: var(--charcoal);
    border: none;
}

.cancel-btn:hover {
    background-color: var(--warm-brown);
    color: var(--white);
}

/* Product Info in Modal */
#modal-product-info {
    background-color: var(--warm-ivory);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--terracotta);
}

.modal-product-title {
    font-size: 1.3rem;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
    font-family: 'Crimson Text', serif;
}

.modal-product-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--terracotta);
    margin-bottom: 0.5rem;
}

.modal-product-details {
    color: var(--warm-brown);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-item {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .gallery-item:nth-child(even) {
        direction: ltr;
    }

    .gallery-image {
        min-height: 300px;
    }

    .gallery-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2.5rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .gallery-collection {
        padding: 3rem 0;
    }

    .gallery-item {
        margin-bottom: 3rem;
    }

    .gallery-content {
        padding: 1.5rem;
    }

    .gallery-title {
        font-size: 1.5rem;
    }

    .gallery-price {
        font-size: 1.7rem;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .review-card {
        padding: 1.5rem;
    }

    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
        width: 95%;
    }

    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 100px 0 60px;
    }

    .page-title {
        font-size: 2rem;
    }

    .gallery-content {
        padding: 1rem;
    }

    .gallery-title {
        font-size: 1.3rem;
    }

    .gallery-description {
        font-size: 0.9rem;
    }

    .gallery-details {
        font-size: 0.8rem;
    }

    .gallery-rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .want-to-buy-btn {
        width: 100%;
        justify-content: center;
    }

    .reviewer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .reviewer-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .review-header {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Animation Classes */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.scale-on-hover {
    transition: transform 0.3s ease;
}

.scale-on-hover:hover {
    transform: scale(1.05);
}

/* Loading States */
.loading-btn {
    position: relative;
    pointer-events: none;
}

.loading-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Success Messages */
.success-message {
    background-color: var(--deep-emerald);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.success-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility Improvements */
.want-to-buy-btn:focus,
.btn:focus {
    outline: 3px solid var(--gold-ochre);
    outline-offset: 2px;
}

.modal-content:focus {
    outline: none;
}

/* Print Styles */
@media print {
    .navbar,
    .want-to-buy-btn,
    .footer {
        display: none !important;
    }

    .gallery-item {
        break-inside: avoid;
        margin-bottom: 2rem;
    }

    .page-header {
        background: none !important;
        color: var(--charcoal) !important;
        padding: 2rem 0;
    }
}
