/* ============================================================
   Smart Gallery - Frontend Styles
   ============================================================ */

:root {
    --sg-primary:      #c85a2e;
    --sg-primary-dark: #a84820;
    --sg-text:         #333333;
    --sg-text-light:   #666666;
    --sg-border:       #dddddd;
}

/* ============================================================
   Gallery Archive
   ============================================================ */

.sg-gallery-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Filters */
.sg-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 14px 0;
}

.sg-filter-select,
.sg-filter-input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--sg-border);
    border-radius: 3px;
    font-size: 13px;
    color: var(--sg-text);
    background: #fff;
    outline: none;
    min-width: 155px;
    box-sizing: border-box;
}

.sg-filter-input       { min-width: 200px; }
.sg-filter-input--sm   { min-width: 130px; }

.sg-filter-select:focus,
.sg-filter-input:focus { border-color: var(--sg-primary); }

.sg-search-btn {
    height: 40px;
    padding: 0 28px;
    background: var(--sg-primary);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
}
.sg-search-btn:hover { background: var(--sg-primary-dark); }

.sg-divider {
    border: none;
    border-top: 1px solid var(--sg-border);
    margin: 2px 0;
}

.sg-gallery-description {
    text-align: center;
    padding: 28px 0 16px;
    font-size: 14px;
    line-height: 1.8;
    max-width: 680px;
    margin: 0 auto;
}

.sg-gallery-description,
.sg-gallery-description p { color: rgba(255,255,255,0.6) !important; }

/* Grid */
.sg-artwork-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px 30px;
    margin-top: 16px;
}

@media (max-width: 900px) { .sg-artwork-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sg-artwork-grid { grid-template-columns: 1fr; } }

/* Card */
.sg-artwork-card {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.sg-artwork-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    margin-bottom: 14px;
    background: #1a1a1a;
}

.sg-artwork-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.sg-artwork-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.35s ease;
}

.sg-artwork-image:hover img { transform: scale(1.04); }

.sg-artist-name {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 0 5px !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.sg-artwork-title {
    font-size: 14px !important;
    color: rgba(255,255,255,0.75) !important;
    margin: 0 0 7px !important;
}

.sg-artwork-meta {
    font-size: 13px !important;
    color: rgba(255,255,255,0.55) !important;
    margin: 3px 0 !important;
}

.sg-artwork-price { font-size: 13px; margin: 7px 0; }

.price-inr { color: var(--sg-primary); font-weight: 600; }
.price-usd { color: rgba(255,255,255,0.5); margin-left: 6px; }

/* Buttons */
.sg-artwork-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.sg-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.sg-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    line-height: 1;
    margin-top: -2px;
}

.sg-btn-details,
.sg-btn-room,
.sg-btn-share { background: var(--sg-primary); color: #fff !important; }

.sg-btn-details:hover,
.sg-btn-room:hover,
.sg-btn-share:hover { background: var(--sg-primary-dark); color: #fff !important; text-decoration: none; }

/* Loading / No results */
.sg-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
}

.sg-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: rgba(255,255,255,0.5);
    font-size: 15px;
}

.sg-spinner {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--sg-primary);
    border-radius: 50%;
    animation: sg-spin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes sg-spin { to { transform: rotate(360deg); } }

/* Load More */
.sg-load-more-wrap { text-align: center; margin: 48px 0 0; }

.sg-load-more-btn {
    padding: 11px 40px;
    background: var(--sg-primary);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.sg-load-more-btn:hover    { background: var(--sg-primary-dark); }
.sg-load-more-btn:disabled { opacity: 0.6; cursor: default; }

/* ============================================================
   Single Artwork Page
   ============================================================ */

.sg-single-artwork {
    max-width: 1100px !important;
    width: 100% !important;
    margin: 40px auto !important;
    padding: 0 20px 60px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box !important;
}

.sg-single-inner {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 50px !important;
    align-items: start !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    .sg-single-inner {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}

.sg-single-image-col {
    min-width: 0;
}

.sg-single-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 2px;
    max-width: 100% !important;
}

.sg-single-image-actions {
    display: flex !important;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.sg-single-details-col {
    min-width: 0;
}

.sg-single-artist {
    color: var(--sg-primary) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    margin: 0 0 6px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    line-height: 1.3 !important;
}

.sg-single-title {
    font-size: 22px !important;
    color: #ffffff !important;
    margin: 0 0 24px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.sg-details-table {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin-bottom: 20px !important;
    font-size: 14px !important;
    background: transparent !important;
    border: none !important;
}

.sg-details-table tr {
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    background: transparent !important;
}

.sg-details-table th,
.sg-details-table td {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.sg-details-table th {
    text-align: left !important;
    padding: 10px 16px 10px 0 !important;
    font-weight: 600 !important;
    color: rgba(255,255,255,0.5) !important;
    width: 140px !important;
    vertical-align: top !important;
    white-space: nowrap !important;
    background: transparent !important;
    font-size: 13px !important;
}

.sg-details-table td {
    padding: 10px 0 !important;
    color: #ffffff !important;
    line-height: 1.5 !important;
    background: transparent !important;
    font-size: 14px !important;
}

.sg-available-text { color: #5dcc5d !important; font-weight: 600 !important; }
.sg-sold-text      { color: #ff6b6b !important; font-weight: 600 !important; }

.sg-price-note {
    font-size: 12px !important;
    color: var(--sg-primary) !important;
    font-style: italic;
    margin-top: 8px !important;
}

/* Related */
.sg-related-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sg-related-section h3 {
    font-size: 20px;
    color: #ffffff !important;
    margin-bottom: 24px;
    font-weight: 600;
}

.sg-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 768px) { .sg-related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .sg-related-grid { grid-template-columns: 1fr; } }

.sg-related-card { display: block; text-decoration: none; transition: opacity 0.2s; }
.sg-related-card:hover { opacity: 0.82; text-decoration: none; }

.sg-related-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    margin-bottom: 8px;
    background: #1a1a1a;
}

.sg-related-title { font-size: 13px; font-weight: 600; margin: 0 0 4px; line-height: 1.4; color: #fff !important; }
.sg-related-price { font-size: 12px; color: var(--sg-primary) !important; margin: 0; }

/* ============================================================
   View In Room Modal
   ============================================================ */

.sg-modal { position: fixed; inset: 0; z-index: 999999; }

.sg-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    cursor: pointer;
}

.sg-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    max-width: 92vw;
}

.sg-modal-close {
    position: absolute;
    top: -42px;
    right: 0;
    font-size: 34px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    padding: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.sg-modal-close:hover { color: #ccc; }

.sg-room-container {
    position: relative;
    width: 820px;
    max-width: 90vw;
    min-height: 460px;
    background: #1a1210;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-room-bg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    position: absolute;
    top: 0; left: 0;
    object-fit: cover;
    height: 100%;
}

.sg-room-bg[src=""],
.sg-room-bg:not([src]) { display: none; }

.sg-room-painting-wrap {
    position: relative;
    z-index: 2;
    width: 55%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 8px #2a2018, 0 0 0 10px #3a2e20;
}

/* When room bg exists, position painting on the wall */
.sg-room-bg[src]:not([src=""]) ~ .sg-room-painting-wrap {
    position: absolute;
    top: 15%;
    left: 25%;
    width: 30%;
}

.sg-room-painting { width: 100%; height: auto; display: block; }

.sg-room-label {
    text-align: center;
    color: #fff;
    font-size: 13px;
    margin-top: 10px;
    font-style: italic;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
    .sg-filters-row   { flex-direction: column; align-items: stretch; }
    .sg-filter-select,
    .sg-filter-input,
    .sg-search-btn    { width: 100%; min-width: unset; }
}
