/* Page-specific tweaks for product page (inherits global styles from style.css) */

:root {
    --container-max: 1200px;
}

.product-hero {
    background: #000;
    color: #fff;
    padding: 6rem 3% 4rem;
    text-align: center;
}

.product-hero h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 2px;
}

.catalog-section {
    padding: 3rem 5% 4rem;
}

.container {
    max-width: var(--container-max);
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.catalog-header {
    text-align: center;
    margin-bottom: 2rem;
}

.catalog-header h2 {
    font-size: 2.2rem;
    letter-spacing: 2px;
    font-weight: 800;
}

.catalog-header .underline {
    width: 70px;
    height: 3px;
    background: #333;
    margin: 0.5rem auto 0;
}

.catalog-grid {
    display: grid;
    gap: 2rem;
    justify-content: center;
    width: 100%;
}

/* modifiers for different containers */
.catalog-grid.grid-4 { grid-template-columns: repeat(4, 1fr); }
.catalog-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }

.catalog-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    margin-top: 10px;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.catalog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.card-media {
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.catalog-card:hover .card-media img {
    transform: scale(1.05);
}

.card-body {
    padding: 1rem;
    text-align: center;
}

.card-body h3 {
    font-size: 1.1rem;
    margin-bottom: .25rem;
}

.card-body .size {
    color: #666;
    font-size: .95rem;
}

.card-actions {
    display: grid;
    /* grid-template-columns: 1fr 1fr; */
}

.btn {
    display: inline-block;
    text-align: center;
    padding: .8rem 0;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
    text-decoration: none;
    border-radius: 4px;
    border-top: 0px;
}

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

.btn.btn-light {
    background: #f5f5f5;
    color: #111;
}

.btn.btn-light:hover {
    background: #e0e0e0;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    color: #000;
}

.btn.btn-dark {
    background: #1f2630;
    color: #fff;
}

.btn.btn-dark:hover {
    background: #76c043;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(118, 192, 67, 0.4);
    color: #fff;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1199px) {
    .catalog-grid.grid-4 { grid-template-columns: repeat(3, 1fr); }
    .catalog-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
    .catalog-grid { margin-top: 10px; }
}

@media (max-width: 767px) {
    .catalog-grid.grid-4 { grid-template-columns: repeat(2, 1fr); }
    .catalog-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
    .catalog-grid { margin-top: 10px; }
}

@media (max-width: 575px) {
    .catalog-grid.grid-4, .catalog-grid.grid-2 { grid-template-columns: 1fr; }

    .product-hero {
        padding: 4rem 3% 2.5rem;
    }
}

/* Fullscreen Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.image-modal.show .modal-content {
    transform: scale(1);
}

.modal-content.zoomed {
    cursor: zoom-out;
    transform: scale(1.5);
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
    user-select: none;
}

.close:hover,
.close:focus {
    color: #76c043;
    text-decoration: none;
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Make product images clickable */
.catalog-card img,
.card-media img {
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.catalog-card img:hover,
.card-media img:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
    .close {
        top: 15px;
        right: 20px;
        font-size: 30px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 80%;
    }
    
    .modal-caption {
        bottom: 10px;
        font-size: 14px;
        padding: 8px 16px;
    }
}