/* MD Registry — Public Styles */

/* General */
.mdregistry-errors {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	border-radius: 4px;
	padding: 12px 16px;
	margin-bottom: 20px;
}

.mdregistry-errors p {
	color: #dc2626;
	margin: 4px 0;
}

.mdregistry-success {
	background: #f0fdf4;
	border: 1px solid #86efac;
	border-radius: 4px;
	padding: 20px;
	margin-bottom: 20px;
}

.mdregistry-help {
	color: #6b7280;
	font-size: 0.9em;
}

.mdregistry-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 0.8em;
	font-weight: 600;
}

.mdregistry-badge--fulfilled {
	background: #dcfce7;
	color: #166534;
}

.mdregistry-badge--reserved {
	background: #fef9c3;
	color: #854d0e;
}

.mdregistry-occasion-badge {
	display: inline-block;
	background: #f3f4f6;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 0.8em;
	color: #4b5563;
	margin-left: 8px;
}

.mdregistry-empty {
	color: #9ca3af;
	font-style: italic;
}

/* Create Registry Form */
.mdregistry-create-form fieldset {
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 20px;
	margin-bottom: 20px;
}

.mdregistry-create-form legend {
	font-weight: 600;
	padding: 0 8px;
}

.mdregistry-create-form label {
	display: block;
	margin-bottom: 4px;
	font-weight: 500;
}

.mdregistry-create-form input[type="text"],
.mdregistry-create-form input[type="email"],
.mdregistry-create-form input[type="tel"],
.mdregistry-create-form input[type="date"],
.mdregistry-create-form select {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 14px;
}

.mdregistry-create-form .required {
	color: #dc2626;
}

.mdregistry-field-row {
	display: flex;
	gap: 16px;
}

.mdregistry-field-row > span {
	flex: 1;
}

/* Public Registry Page */
.mdregistry-public-registry .mdregistry-registry-header {
	margin-bottom: 30px;
}

.mdregistry-items-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

.mdregistry-item {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 0.2s;
}

.mdregistry-item:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mdregistry-item--fulfilled {
	opacity: 0.7;
}

.mdregistry-item-image img {
	width: 100%;
	height: auto;
	display: block;
}

.mdregistry-item-details {
	padding: 16px;
}

.mdregistry-item-title {
	margin: 0 0 8px;
	font-size: 1em;
}

.mdregistry-item-title a {
	text-decoration: none;
	color: #111;
}

.mdregistry-item-price {
	color: #4b5563;
	margin: 0 0 8px;
}

.mdregistry-item-quantity {
	font-size: 0.9em;
	color: #6b7280;
	margin: 0 0 12px;
}

.mdregistry-item-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mdregistry-qty-select {
	padding: 6px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	width: 60px;
}

.mdregistry-add-to-cart-btn {
	flex: 1;
}

/* Search Page */
.mdregistry-search-form input[type="text"] {
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 15px;
	width: 300px;
	max-width: 100%;
}

.mdregistry-search-results {
	margin-top: 20px;
}

.mdregistry-search-result {
	border-bottom: 1px solid #f3f4f6;
	padding: 16px 0;
}

.mdregistry-search-result h3 {
	margin: 0 0 4px;
}

.mdregistry-search-result h3 a {
	text-decoration: none;
	color: #111;
}

.mdregistry-date {
	color: #6b7280;
	font-size: 0.9em;
	margin-left: 8px;
}

.mdregistry-access-section {
	margin-top: 40px;
	padding-top: 30px;
	border-top: 1px solid #e5e7eb;
}

/* Access Form */
.mdregistry-access-form input[type="email"] {
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	width: 300px;
	max-width: 100%;
}

.mdregistry-form-message {
	padding: 10px;
	border-radius: 4px;
	margin-top: 10px;
}

.mdregistry-form-message.success {
	background: #f0fdf4;
	color: #166534;
}

.mdregistry-form-message.error {
	background: #fef2f2;
	color: #dc2626;
}

/* Management Pages */
.mdregistry-manage-registry {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 24px;
}

.mdregistry-share-url {
	font-size: 0.9em;
	color: #6b7280;
}

.mdregistry-share-url a {
	word-break: break-all;
}

.mdregistry-items-table {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
}

.mdregistry-items-table th,
.mdregistry-items-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid #f3f4f6;
}

.mdregistry-items-table th {
	font-weight: 600;
	font-size: 0.85em;
	color: #6b7280;
	text-transform: uppercase;
}

.mdregistry-item-product {
	display: flex;
	align-items: center;
	gap: 10px;
}

.mdregistry-item-product img {
	border-radius: 4px;
}

.mdregistry-inline-form {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.mdregistry-qty-input {
	width: 60px;
	padding: 4px 8px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
}

.mdregistry-remove-btn {
	color: #dc2626 !important;
	border-color: #fca5a5 !important;
}

.mdregistry-manage-actions {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #f3f4f6;
}

.mdregistry-archive-btn {
	color: #9ca3af !important;
}

/* Wishlist Management */
.mdregistry-create-wishlist {
	margin-bottom: 24px;
}

.mdregistry-create-wishlist input[type="text"] {
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
}

.mdregistry-wishlist-section {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.mdregistry-wishlist-header h3 {
	margin: 0 0 4px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.mdregistry-badge-subtle {
	font-size: 0.7em;
	font-weight: 400;
	font-style: italic;
	color: #9ca3af;
}

.mdregistry-rename-trigger {
	background: none;
	border: none;
	padding: 2px;
	cursor: pointer;
	color: #9ca3af;
	line-height: 1;
	display: inline-flex;
	vertical-align: middle;
}

.mdregistry-rename-trigger:hover {
	color: #4b5563;
}

.mdregistry-rename-form {
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.mdregistry-rename-form input[type="text"] {
	padding: 6px 10px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
}

.mdregistry-trash-btn {
	background: none;
	border: none;
	padding: 6px;
	cursor: pointer;
	color: #9ca3af;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border-radius: 4px;
}

.mdregistry-trash-btn:hover {
	color: #dc2626;
	background: #fef2f2;
}

.mdregistry-trash-btn--text {
	font-size: 0.85em;
}

.mdregistry-wishlist-footer {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid #f3f4f6;
	display: flex;
	align-items: center;
	gap: 12px;
}

.mdregistry-wishlist-footer button,
.mdregistry-wishlist-footer .mdregistry-action-btn,
.mdregistry-wishlist-footer .mdregistry-trash-btn,
.mdregistry-wishlist-footer form {
	margin: 0 !important;
}

.mdregistry-qty-form {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 6px 0;
}

.mdregistry-qty-form label {
	font-size: 0.85em;
	color: #6b7280;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.mdregistry-wishlist-notice {
	background: #f0fdf4;
	border: 1px solid #86efac;
	border-radius: 6px;
	padding: 12px 16px;
	margin-bottom: 16px;
	font-size: 0.95em;
	color: #166534;
}

.mdregistry-wishlist-notice a {
	color: #2563eb;
	font-weight: 600;
	text-decoration: underline;
}

.mdregistry-create-wishlist {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #e5e7eb;
}

.mdregistry-create-wishlist h3 {
	margin-top: 0;
}

.mdregistry-wishlist-items {
	margin-top: 16px;
}

.mdregistry-wishlist-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid #f3f4f6;
}

.mdregistry-wishlist-item-image img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 4px;
}

.mdregistry-wishlist-item-details {
	flex: 1;
}

.mdregistry-wishlist-item-details h4 {
	margin: 0 0 4px;
}

.mdregistry-wishlist-item-details h4 a {
	text-decoration: none;
	color: #111;
}

.mdregistry-per-each {
	font-size: 0.8em;
	color: #9ca3af;
	margin-left: 2px;
}

.mdregistry-wishlist-item-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	flex-shrink: 0;
}

.mdregistry-wishlist-item-actions form {
	margin: 0;
	padding: 0;
}

.mdregistry-action-btn {
	background: none;
	border: none;
	padding: 6px 10px;
	cursor: pointer;
	border-radius: 4px;
	white-space: nowrap;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.85em;
	font-family: inherit;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	line-height: 1;
}

.mdregistry-action-btn--cart {
	color: #2563eb;
	font-weight: 700;
}

.mdregistry-action-btn--cart:hover {
	color: #1d4ed8;
	background: #eff6ff;
}

.mdregistry-action-btn--remove {
	color: #9ca3af;
	margin-right: 0 !important;
}

.mdregistry-action-btn--cart {
	margin-right: 0 !important;
}

.mdregistry-action-btn--remove:hover {
	color: #dc2626;
	background: #fef2f2;
}

/* Product Page Buttons */
.mdregistry-product-buttons {
	margin-top: 10px;
	line-height: 1.2;
}

.mdregistry-product-buttons button,
.mdregistry-product-buttons .button {
	margin-bottom: 0;
	vertical-align: middle;
}

.mdregistry-product-buttons .mdregistry-wishlist-heart,
.mdregistry-product-buttons .mdregistry-registry-icon {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	height: auto;
}

.mdregistry-wishlist-toggle {
	cursor: pointer;
}

.mdregistry-wishlist-toggle[data-in-wishlist="1"] {
	font-weight: 600;
}

/* Heart icon style */
.mdregistry-wishlist-heart {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	line-height: 1;
	display: inline-flex;
	align-items: center;
}

.mdregistry-wishlist-heart .mdregistry-heart-icon {
	fill: none;
	stroke: #999;
	stroke-width: 1.5;
	transition: fill 0.2s, stroke 0.2s;
}

.mdregistry-wishlist-heart:hover .mdregistry-heart-icon {
	stroke: #e53e3e;
}

.mdregistry-wishlist-heart--active .mdregistry-heart-icon {
	fill: #e53e3e;
	stroke: #e53e3e;
}

.mdregistry-see-wishlist-link {
	display: block;
	margin-top: 2px;
	margin-bottom: 8px;
	font-size: 0.85em;
	text-decoration: none;
	color: #6b7280;
}

.mdregistry-see-wishlist-link:hover,
.mdregistry-other-variation-link:hover {
	color: #111;
	text-decoration: underline;
}

.mdregistry-other-variation-link {
	display: block;
	margin-top: 2px;
	margin-bottom: 8px;
	font-size: 0.85em;
	font-style: italic;
	text-decoration: none;
	color: #9ca3af;
}

/* Shipping Choice */
.mdregistry-shipping-choice {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 20px;
	margin-bottom: 20px;
}

.mdregistry-shipping-choice h3 {
	margin-top: 0;
}

.mdregistry-hidden-address {
	position: absolute;
	left: -9999px;
}

/* Gift icon style */
.mdregistry-registry-icon {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	color: #999;
	transition: color 0.2s;
}

.mdregistry-registry-icon:hover {
	color: #5b21b6;
}

.mdregistry-registry-icon--active {
	color: #5b21b6;
}

.mdregistry-registry-icon--active .mdregistry-gift-icon path {
	fill: #5b21b6;
}

/* Shared Wishlist */
.mdregistry-shared-wishlist-header {
	margin-bottom: 20px;
}

.mdregistry-shared-by {
	color: #6b7280;
	font-size: 0.9em;
}

.mdregistry-shared-qty {
	font-size: 0.85em;
	color: #6b7280;
	margin: 4px 0;
}

/* Registry Prompt Modal */
.mdregistry-registry-prompt {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mdregistry-registry-prompt-inner {
	background: #fff;
	border-radius: 8px;
	padding: 30px;
	max-width: 440px;
	width: 90%;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.mdregistry-registry-prompt-inner h3 {
	margin-top: 0;
}

.mdregistry-registry-prompt-inner input[type="email"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 15px;
}

.mdregistry-prompt-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.mdregistry-prompt-close {
	background: none;
	border: none;
	color: #6b7280;
	cursor: pointer;
	padding: 8px;
}

.mdregistry-prompt-close:hover {
	color: #111;
}

/* Cart Timer */
.mdregistry-cart-timer {
	background: #fef9c3;
	border: 1px solid #fde68a;
	border-radius: 4px;
	padding: 10px 16px;
	margin-bottom: 16px;
	font-size: 0.9em;
}

.mdregistry-cart-timer strong {
	font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 600px) {
	.mdregistry-field-row {
		flex-direction: column;
		gap: 0;
	}

	.mdregistry-items-grid {
		grid-template-columns: 1fr;
	}

	.mdregistry-wishlist-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.mdregistry-search-form input[type="text"],
	.mdregistry-access-form input[type="email"] {
		width: 100%;
	}
}
