/* Stanroy Inventory Manager - Public styles */

/* Price on red background - ensure white for visibility */
.stanroy-inventory-page .stanroy-listing-price,
.stanroy-inventory-page .stanroy-price,
.stanroy-inventory-page .stanroy-listing-card .stanroy-listing-price,
.stanroy-inventory-page p {
	color: #fff !important;
}

/* Catalog cards - Stanroy theme */
.stanroy-inventory-grid .stanroy-listing-card {
	display: block;
	text-decoration: none;
	color: inherit;
	padding: 12px;
	border-radius: 4px;
	background-color: #3f1515;
	border: 1px solid rgba(231, 190, 102, 0.4);
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.stanroy-inventory-grid .stanroy-listing-card:hover,
.stanroy-inventory-grid .stanroy-listing-card:focus {
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);
	transform: translateY(-2px);
	border-color: #e7be66;
}
.stanroy-inventory-grid h3.stanroy-listing-title {
	font-size:20px;
}

.stanroy-inventory-grid .stanroy-listing-image {
	width: 100%;
	max-width: 420px;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f0f0f0;
	margin: 0 auto 10px;
	border-radius: 4px;
}
.stanroy-inventory-grid .stanroy-listing-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.stanroy-inventory-grid .stanroy-listing-price {
	font-weight: bold;
	margin: 0;
}

/* Catalog toolbar: category + sort */
.stanroy-inventory-page .stanroy-inventory-filterbar {
    margin-bottom: 20px;
}

.stanroy-inventory-page .stanroy-inventory-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(231, 190, 102, 0.35);
    border-radius: 8px;
    align-items: flex-end;
}

.stanroy-inventory-page .stanroy-toolbar-group {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stanroy-inventory-page .stanroy-toolbar-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #e7be66;
    font-weight: 600;
}

.stanroy-inventory-page .stanroy-category-select,
.stanroy-inventory-page .stanroy-sort-select {
    width: 100%;
    padding: 7px 12px;
    border-radius: 8px;
    background: #3f1515;
    color: #e7be66;
    border: 1px solid rgba(231, 190, 102, 0.8);
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #e7be66 50%),
        linear-gradient(135deg, #e7be66 50%, transparent 50%);
    background-position:
        calc(100% - 14px) 50%,
        calc(100% - 9px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.stanroy-inventory-page .stanroy-category-select:focus,
.stanroy-inventory-page .stanroy-sort-select:focus {
    outline: none;
    border-color: #e7be66;
    box-shadow: 0 0 0 2px rgba(231, 190, 102, 0.25);
}

/* Small icons in labels using Dashicons */
.stanroy-inventory-page label[for="stanroy-category-select"]::before,
.stanroy-inventory-page label[for="stanroy-sort-select"]::before {
    font-family: dashicons;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    margin-right: 4px;
    vertical-align: middle;
}

.stanroy-inventory-page label[for="stanroy-category-select"]::before {
    content: "\f318"; /* category icon */
}

.stanroy-inventory-page label[for="stanroy-sort-select"]::before {
    content: "\f163"; /* sort icon */
}

@media (max-width: 767px) {
    .stanroy-inventory-page .stanroy-inventory-toolbar {
        /* Stay inline when there's room; wrap naturally when not. */
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
        padding: 8px;
    }
}

/* Detail page - back button */
.stanroy-detail-back {
	display: inline-block;
	margin-bottom: 20px;
	padding: 8px 16px;
	background: #6d1214;
	color: #fff;
	border: 1px solid #e7be66;
	border-radius: 4px;
	text-decoration: none;
	transition: background 0.2s, border-color 0.2s;
}
.stanroy-detail-back:hover,
.stanroy-detail-back:focus {
	background: #801417;
	border-color: #e7be66;
	color: #fff;
	text-decoration: none;
}

/* Detail page - gallery with thumbnails */
.stanroy-gallery-wrap {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 24px;
	padding: 5px;
}
@media (min-width: 768px) {
	.stanroy-gallery-wrap {
		flex-direction: row;
		align-items: flex-start;
	}
	.stanroy-gallery-main {
		flex: 0 0 80%;
		max-width: 80%;
	}
	.stanroy-gallery-thumbs {
		flex: 0 0 calc(20% - 12px);
		flex-direction: column;
	}
}
.stanroy-gallery-main {
	border-radius: 4px;
	overflow: hidden;
	background: #f5f5f5;
}
.stanroy-gallery-main img {
	width: 100%;
	max-width: 100%;
	height: auto;
	display: block;
	cursor: pointer;
}
.stanroy-gallery-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	background: #212121;
	padding: 5px;
	border-radius: 4px;
}
.stanroy-gallery-thumbs .stanroy-thumb {
	flex: 0 0 70px;
	height: 70px;
	overflow: hidden;
	border-radius: 4px;
	border: 2px solid transparent;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s, border-color 0.2s;
}
.stanroy-gallery-thumbs .stanroy-thumb:hover,
.stanroy-gallery-thumbs .stanroy-thumb.active {
	opacity: 1;
	border-color: #e7be66;
}
.stanroy-gallery-thumbs .stanroy-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Lightbox modal */
.stanroy-lightbox {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.9);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.stanroy-lightbox.stanroy-lightbox-open,
.stanroy-lightbox.active {
	display: flex;
}
.stanroy-lightbox img {
	max-width: 100%;
	max-height: 90vh;
	object-fit: contain;
}
.stanroy-lightbox-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: #6d1214;
	border: 1px solid #e7be66;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 24px;
	cursor: pointer;
	line-height: 1;
	color: #e7be66;
}
.stanroy-lightbox-close:hover {
	background: #801417;
	color: #fff;
	border-color: #e7be66;
}

/* Detail page - Share button Stanroy theme */
.stanroy-inventory-page .stanroy-share .btn,
.stanroy-inventory-page #stanroy-share-btn {
	background-color: #6d1214 !important;
	border-color: #e7be66 !important;
	color: #e7be66 !important;
}
.stanroy-inventory-page .stanroy-share .btn:hover,
.stanroy-inventory-page .stanroy-share .btn:focus,
.stanroy-inventory-page #stanroy-share-btn:hover,
.stanroy-inventory-page #stanroy-share-btn:focus {
	background-color: #801417 !important;
	border-color: #e7be66 !important;
	color: #fff !important;
}
