/* ============================================================
   Adra Paintings — Mockup Generator v2.0
   Font: Poppins 200 (body) / 800 (headings/buttons)
   Palette: black #000, white #fff, mid-grey #666
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;800&display=swap');

/* ----------------------------------------------------------
   Root container
   ---------------------------------------------------------- */
#mockup-app {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px 60px;
    font-family: 'Poppins', sans-serif;
}

/* ----------------------------------------------------------
   UI step labels (non-semantic — p instead of h2/h3 for SEO)
   ---------------------------------------------------------- */
#mockup-app .mockup-label {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 800 !important;
    font-size: 18px !important;
    color: #000 !important;
    margin: 0 0 14px !important;
    letter-spacing: .3px;
}
#mockup-app p,
#mockup-app label {
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    font-weight: 200 !important;
    color: #000 !important;
    line-height: 1.6;
}

/* ----------------------------------------------------------
   Tabs  (generator mode)
   ---------------------------------------------------------- */
.mockup-tabs {
    display: flex;
    border-bottom: 2px solid #000;
    margin-bottom: 36px;
    gap: 0;
}
.mockup-tab {
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 14px 28px !important;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #666 !important;
    margin-bottom: -2px;
    transition: color .2s, border-color .2s;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: 0 !important;
}
.mockup-tab:hover  { color: #000 !important; }
.mockup-tab.active {
    color: #000 !important;
    border-bottom-color: #000 !important;
}

/* ----------------------------------------------------------
   Section spacing
   ---------------------------------------------------------- */
.mockup-section {
    margin-bottom: 36px;
}

/* ----------------------------------------------------------
   Upload input
   ---------------------------------------------------------- */
#mockup-upload {
    display: block;
    padding: 14px 16px;
    border: 2px solid #000 !important;
    width: 100%;
    max-width: 420px;
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    font-weight: 200 !important;
    color: #000 !important;
    background: #fff !important;
    cursor: pointer;
    transition: border-color .2s;
}
#mockup-upload:hover { border-color: #666 !important; }

/* ----------------------------------------------------------
   Primary button (shared)
   ---------------------------------------------------------- */
#mockup-generate,
#browse-generate {
    display: inline-block;
    background: #000 !important;
    color: #fff !important;
    padding: 18px 36px !important;
    border: 2px solid #000 !important;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: .6px;
    border-radius: 0 !important;
    transition: background .2s, color .2s;
    margin: 10px 0 30px;
}
#mockup-generate:hover,
#browse-generate:hover {
    background: #fff !important;
    color: #000 !important;
}

/* ----------------------------------------------------------
   Templates grid
   ---------------------------------------------------------- */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 10px 0 0;
}
.template-item {
    border: 2px solid #ddd;
    padding: 8px;
    cursor: pointer;
    transition: border-color .2s;
}
.template-item:hover  { border-color: #888; }
.template-item.active { border: 3px solid #000; }
.template-item img    { width: 100%; height: 160px; object-fit: cover; display: block; }
.template-item p      {
    margin: 8px 0 2px;
    text-align: center;
    font-weight: 800 !important;
    font-size: 13px !important;
    color: #000 !important;
}

/* ----------------------------------------------------------
   Browse wizard
   ---------------------------------------------------------- */
#browse-wizard { margin-top: 10px; }

/* Breadcrumb progress */
.wizard-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
    align-items: center;
}
.wp-crumb {
    font-size: 12px !important;
    font-weight: 800 !important;
    background: #000;
    color: #fff !important;
    padding: 4px 12px;
    display: none;
}
.wp-crumb:not(:empty) { display: inline-block; }

/* Back button */
.back-btn {
    background: none !important;
    border: none !important;
    padding: 0 0 18px !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #000 !important;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .4px;
    display: block;
}
.back-btn:hover { text-decoration: underline; }

/* Collection grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.collection-card {
    border: 2px solid #000;
    padding: 22px 16px;
    cursor: pointer;
    text-align: center;
    transition: background .2s, color .2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.collection-card:hover  { background: #000; }
.collection-card:hover .coll-name,
.collection-card:hover .coll-meta { color: #fff !important; }
.coll-name {
    font-weight: 800 !important;
    font-size: 15px !important;
    color: #000 !important;
}
.coll-meta {
    font-weight: 200 !important;
    font-size: 12px !important;
    color: #666 !important;
}

/* Painting grid */
.painting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.painting-card {
    border: 2px solid #ddd;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s;
}
.painting-card:hover { border-color: #000; }
.painting-img {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f0f0f0;
}
.painting-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.painting-card:hover .painting-img img { transform: scale(1.04); }
.painting-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}
.painting-img--placeholder::after {
    content: 'No photo yet';
    font-size: 11px;
    color: #bbb;
}
.painting-name {
    padding: 10px 12px;
    font-weight: 800 !important;
    font-size: 13px !important;
    color: #000 !important;
    margin: 0 !important;
}

/* Type row */
.type-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.type-btn {
    border: 2px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
    padding: 20px 30px !important;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    transition: background .2s, color .2s;
    text-align: left;
    border-radius: 0 !important;
}
.type-btn strong {
    font-size: 16px;
    font-weight: 800;
    display: block;
}
.type-btn span {
    font-size: 13px;
    font-weight: 200;
}
.type-btn:hover,
.type-btn.active {
    background: #000 !important;
    color: #fff !important;
}

/* Size row */
.size-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.size-btn {
    border: 2px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
    padding: 12px 20px !important;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    border-radius: 0 !important;
    transition: background .2s, color .2s;
}
.size-btn:hover,
.size-btn.active {
    background: #000 !important;
    color: #fff !important;
}

/* ----------------------------------------------------------
   Canvas preview
   ---------------------------------------------------------- */
.mockup-preview-wrap { margin-top: 30px; }
.canvas-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    user-select: none;
    -webkit-user-select: none;
}
#mockup-canvas {
    display: block;
    max-width: 100%;
    border: 1px solid #ddd;
    pointer-events: none;
}
.canvas-protect-overlay {
    position: absolute;
    inset: 0;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}
.preview-note {
    margin: 12px 0 20px !important;
    font-style: italic;
    color: #666 !important;
}

/* Inline email gate */
.email-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-top: 6px;
}
.email-inline input[type="email"] {
    flex: 1;
    min-width: 220px;
    padding: 14px 16px;
    border: 2px solid #000 !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    font-weight: 200 !important;
    color: #000 !important;
    background: #fff !important;
    outline: none;
}
.email-inline input[type="email"]:focus { border-color: #666 !important; }
#mockup-email-btn-inline {
    background: #000 !important;
    color: #fff !important;
    padding: 14px 28px !important;
    border: 2px solid #000 !important;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    border-radius: 0 !important;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
#mockup-email-btn-inline:hover {
    background: #fff !important;
    color: #000 !important;
}

/* Download confirmation */
.download-confirmation { padding: 20px 0; }
.success-msg {
    font-weight: 800 !important;
    font-size: 16px !important;
    margin-bottom: 8px !important;
}

/* ----------------------------------------------------------
   Upload preview
   ---------------------------------------------------------- */
.upload-preview { padding: 10px 0; }
.upload-preview img {
    max-width: 300px;
    border: 2px solid #000;
    display: block;
    margin: 12px 0;
}
.hint { color: #666 !important; font-style: italic; }

/* ----------------------------------------------------------
   Loading spinner
   ---------------------------------------------------------- */
.loading-container {
    text-align: center;
    padding: 50px 20px;
}
.spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 20px;
    border: 4px solid #eee;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-text {
    font-weight: 800 !important;
    font-size: 16px !important;
    color: #000 !important;
}

/* ----------------------------------------------------------
   Error state
   ---------------------------------------------------------- */
.mockup-error {
    border: 2px solid #000;
    padding: 14px 18px;
    font-weight: 800 !important;
    font-size: 14px !important;
}

/* ----------------------------------------------------------
   Email modal
   ---------------------------------------------------------- */
#mockup-email-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.75);
}
.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 44px;
    border: 2px solid #000;
    width: 90%;
    max-width: 480px;
    z-index: 1;
}
.modal-content h3 {
    font-weight: 800 !important;
    font-size: 20px !important;
    margin: 0 0 10px !important;
    color: #000 !important;
}
.modal-content p {
    margin: 0 0 20px !important;
    color: #666 !important;
}
#mockup-email-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #000 !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    font-weight: 200 !important;
    color: #000 !important;
    background: #fff !important;
    outline: none;
    margin-bottom: 16px;
    box-sizing: border-box;
}
#mockup-email-input:focus { border-color: #666 !important; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#mockup-email-submit {
    background: #000 !important;
    color: #fff !important;
    padding: 16px 28px !important;
    border: 2px solid #000 !important;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    border-radius: 0 !important;
    transition: background .2s, color .2s;
}
#mockup-email-submit:hover { background: #fff !important; color: #000 !important; }
#mockup-email-close {
    background: #fff !important;
    color: #000 !important;
    padding: 16px 28px !important;
    border: 2px solid #000 !important;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    border-radius: 0 !important;
    transition: background .2s, color .2s;
}
#mockup-email-close:hover { background: #000 !important; color: #fff !important; }

/* ----------------------------------------------------------
   Result areas
   ---------------------------------------------------------- */
#upload-result,
#browse-result,
#product-result,
#catalog-result { margin-top: 20px; }

/* ----------------------------------------------------------
   Product mode — casual heading
   ---------------------------------------------------------- */
#mockup-app .product-heading {
    font-weight: 800 !important;
    font-size: 18px !important;
    color: #000 !important;
    margin: 0 0 20px !important;
    line-height: 1.4 !important;
}

/* ----------------------------------------------------------
   Product mode — result area (canvas sits at top)
   ---------------------------------------------------------- */
#product-result {
    margin-bottom: 0;
}

/* ----------------------------------------------------------
   Product mode — template strip (one row, equal thumbnails)
   ---------------------------------------------------------- */
#product-templates-section {
    margin-top: 20px;
}
.product-template-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}
.product-template-strip .template-item {
    flex: 0 0 auto;
    width: 150px;
    border: 2px solid #ddd;
    padding: 0;
    cursor: pointer;
    transition: border-color .2s;
}
.product-template-strip .template-item:hover  { border-color: #888; }
.product-template-strip .template-item.active { border: 3px solid #000; }
.product-template-strip .template-item img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    display: block;
}

/* ----------------------------------------------------------
   Product mode — size section
   ---------------------------------------------------------- */
#product-size-section {
    margin-top: 16px;
}
/* For originals: static size label (no button) */
.original-size-info {
    font-weight: 200 !important;
    font-size: 13px !important;
    color: #666 !important;
    margin: 0 !important;
    font-style: italic;
}

/* ----------------------------------------------------------
   Catalog mode — painting selector (single scrollable row)
   ---------------------------------------------------------- */
#catalog-paintings-section {
    margin-bottom: 24px;
}
.catalog-painting-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
    cursor: grab;
}
.catalog-painting-grid:active { cursor: grabbing; }
.catalog-painting-item {
    flex: 0 0 auto;
    width: 78px;
    cursor: pointer;
    border: 2px solid #ddd;
    overflow: hidden;
    transition: border-color .2s;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}
.catalog-painting-item:hover  { border-color: #888; }
.catalog-painting-item.active { border: 3px solid #000; }
.catalog-painting-item img {
    width: 100% !important;
    height: 54px !important;
    max-height: 54px !important;
    object-fit: cover !important;
    display: block;
    flex-shrink: 0;
    transition: transform .3s;
}
.catalog-painting-item:hover img { transform: scale(1.04); }
.catalog-painting-placeholder {
    width: 100%;
    height: 54px !important;
    max-height: 54px !important;
    background: #f0f0f0;
    flex-shrink: 0;
}
.catalog-painting-name {
    padding: 5px 8px 6px;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #000 !important;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----------------------------------------------------------
   Catalog mode — template + size section spacing
   ---------------------------------------------------------- */
#catalog-templates-section {
    margin-top: 20px;
}
#catalog-size-section {
    margin-top: 16px;
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    .templates-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .template-item img { height: 120px; }
    .collection-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .painting-grid   { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .painting-img    { height: 120px; }
    .modal-content   { padding: 30px 22px; }
    .type-row        { flex-direction: column; }
    .mockup-tabs     { flex-direction: column; border-bottom: none; }
    .mockup-tab      { border-bottom: 1px solid #ddd !important; padding: 12px 16px !important; }
    .mockup-tab.active { border-left: 3px solid #000 !important; border-bottom: 1px solid #ddd !important; }
    #mockup-app h2   { font-size: 18px !important; }
    #mockup-app h3   { font-size: 15px !important; }

    /* Catalog painting strip — desktop size (78px) is already touch-friendly */
}
