/* ========================================================================== */
/*  GALLERY & ARTWORK CARDS                                                   */
/*  Responsive grid layout for artworks and product cards.                     */
/* ========================================================================== */


/* ==========================================================================
   ARTWORK GRID
   Flexible, centered grid that scales gracefully across breakpoints.
   ========================================================================== */

.artworks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 80px 120px;
    background-color: #ffffff;

    /* Keep gallery within viewport horizontally */
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-x: hidden;
}


/* ==========================================================================
   ARTWORK CARD
   Individual product tile for a single artwork.
   ========================================================================== */

.artwork {
    width: 100%;                  /* let the grid define final width */
    max-width: 300px;             /* avoid overly wide cards */
    margin: 0 auto;               /* center inside grid column */
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-radius 0.2s ease;
}

/* Subtle hover elevation for desktop */
.artwork:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.10);
    border-radius: 20px;
}

/* Artwork image inside card */
.artwork img {
    width: 100%;
    height: 460px;
    object-fit: contain;
    background: #ffffff;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Large image in modal reuses .artwork-large from modals file;
   we only ensure pointer is neutral here for clarity. */
.artwork-modal .artwork-large {
    cursor: default;
}

/* Artwork title */
.artwork h3 {
    font-size: 1.5rem;
    color: #2c2c2c;
    font-weight: 600;
    margin: 0 0 15px;
    text-align: center;
}

/* Artwork price */
.artwork .price {
    font-size: 1.3rem;
    color: #555;
    margin: 0 0 20px;
}


/* ==========================================================================
   ACTIONS
   Primary call-to-action button on each artwork card.
   ========================================================================== */

.add-to-cart {
    background: #000000;
    color: #ffffff;
    border: 1px solid #000000;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

/* Active / hover state for the CTA */
.add-to-cart:hover {
    background: #111111;
    color: #f3e4c5;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

/* Disabled state (e.g. already in checkout or unavailable) */
.add-to-cart.disabled {
    background-color: #d3d3d3;
    color: #a9a9a9;
    cursor: not-allowed;
    pointer-events: none;
    border: 1px solid #c0c0c0;
    box-shadow: none;
}


/* ==========================================================================
   RESPONSIVE LAYOUT
   Keep cards readable and composition tight on tablets and phones.
   ========================================================================== */


/* Tablets & small laptops (≤ 1024px)
   Slightly reduce padding and gap to keep gallery compact. */
@media (max-width: 1024px) {
    .artworks {
        padding: 60px 40px;
        gap: 24px;
        max-width: 100%;
    }
}


/* Phones & small tablets (≤ 768px)
   Collapse to a single column; soften shadows and adjust proportions. */
@media (max-width: 768px) {

    .artworks {
        grid-template-columns: 1fr;        /* one card per row */
        padding: 24px 16px 40px;
        gap: 20px;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .artwork {
        max-width: 100%;                   /* take full column width */
        border-radius: 16px;
        padding: 14px 14px 18px;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
        gap: 10px;
    }

    .artwork img {
        height: auto;                      /* allow image to define height */
        max-height: 360px;                 /* avoid excessively tall cards */
    }

    .artwork h3 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .artwork .price {
        font-size: 1.1rem;
        margin-bottom: 14px;
    }

    .add-to-cart {
        width: 100%;
        max-width: 260px;
        font-size: 0.95rem;
        padding: 10px 16px;
    }
}


/* Extra small screens (≤ 480px)
   Tighten horizontal padding for edge-to-edge feel without overflow. */
@media (max-width: 480px) {
    .artworks {
        padding-inline: 12px;
        gap: 16px;
    }

    .artwork {
        padding: 12px 12px 16px;
        border-radius: 14px;
    }

    .artwork img {
        max-height: 320px;
    }
}
